module Mongoid
Used to store an encrypted date in Mongo
Usage: field :birth_date, type: Mongoid::EncryptedDate
Set with an unencrypted date p = Person.new() p.birth_date = Date.new(2000, 1, 1)
Get returns the unencrypted date puts p.birth_date -> 'Jan 1, 2000'
Use the encrypted property to see the encrypted value puts p.birth_date.encrypted -> '.…'
Used to store an encrypted datetime in Mongo
Usage: field :birth_date, type: Mongoid::EncryptedDate
Set with an unencrypted date p = Person.new() p.birth_date = Date.new(2000, 1, 1)
Get returns the unencrypted date puts p.birth_date -> 'Jan 1, 2000'
Use the encrypted property to see the encrypted value puts p.birth_date.encrypted -> '.…'
Used to store an encrypted string in Mongo
Usage: field :social_security_number, type: Mongoid::EncryptedString
Set with an unencrypted string p = Person.new() p.social_security_number = '123456789'
Get returns the unencrypted string puts p.social_security_number -> '123456789'
Use the encrypted property to see the encrypted value puts p.social_security_number.encrypted -> '.…'
Used to store an encrypted time in Mongo
Usage: field :birth_date, type: Mongoid::EncryptedDate
Set with an unencrypted date p = Person.new() p.birth_date = Date.new(2000, 1, 1)
Get returns the unencrypted date puts p.birth_date -> 'Jan 1, 2000'
Use the encrypted property to see the encrypted value puts p.birth_date.encrypted -> '.…'