mongodb - Meteor $and with $or -
i'm trying $and , $or in meteor mongo query have following doesn't seem working
would query match documents organizationid key has value in variable user.organizationid , type key either 'converntional' or 'transition'
{ organizationid: user.organizationid, $and:[ { $or:[ {type: 'conventional'}, {type: 'transition'} ]} ] };
i can't use $not i'm pretty sure it's not supported in meteor. right package i'm using not support it.
the following query describes after uses $in
operator match documents type key either 'converntional'
or 'transition'
. $and
operator implicitly provided when specifying comma separated list of expressions. using explicit , $and
operator necessary when same field or operator has specified in multiple expressions.
would query match documents organizationid key has value in variable user.organizationid , type key either 'converntional' or 'transition'
{ organizationid: user.organizationid, type: { $in : ['conventional', 'transition'] } }
Comments
Post a Comment