Closed ErickFabian closed 5 years ago
what will User.where({username: { "$type": "null"}})
return?
@javierg
[#<User:0x00007fcedd9d4960
@account_active=true,
@allocated_aluzo=false,
@type=nil,
@username=nil>,
#<User:0x00007fcee43a4110
@account_active=true,
@allocated_aluzo=false,
@username=nil
]
returns an array of objects that have nil usernames
@javierg Should i validate the correct values are used for the $type
operator as a better developer experience?
Valid values are "null", "boolean", "number", "string", "array", and "object".
Enables querys such as:
query = {and: [{ type: { eq: 'user' } } , { username: { eq: 'ErickFabian'}} ]}
User.where(query)
=>[....]
and
User.where({username: { "$type": "null"}})