Alessio Dione
2013-04-17 16:16:42 UTC
Hi there,
I tried googling and searching the group but couldn't find anything on this
specific case,
basically I need to look up using a regex in field A OR field B so I wrote
the equivalent of:
{
cid: 'xxxxxxx',
'$or': [
{ title: {'$regex': 'aaaa', '$options': 'i'} },
{ members: { '$regex': 'aaaa', '$options': 'i'} }
],
refids: {
'$in': [
"5167cb7dd6d68b8928000001",
"5167cf6356e26a2a2b000001"
]
}
}
However I'm getting this error from mongoosejs:
ERR: [Error: Can't use $options with Array.]
While the same works in the mongodb command line (converting the object ids
to proper object
rather than strings).
Am I understanding correctly that this is a mongoosejs limitation? How to
workaround it?
I'm using mongoose 3.6.5 with nodejs 0.10.4 on ubuntu linux.
Thanks,
Alessio
--
Documentation - http://mongoosejs.com/
Plugins - http://plugins.mongoosejs.com/
Bug Reports - http://github.com/learnboost/mongoose
Production Examples - http://mongoosejs.tumblr.com/
StackOverflow - http://stackoverflow.com/questions/tagged/mongoose
Google Groups - https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm
Twitter - https://twitter.com/mongoosejs
IRC - #mongoosejs
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
I tried googling and searching the group but couldn't find anything on this
specific case,
basically I need to look up using a regex in field A OR field B so I wrote
the equivalent of:
{
cid: 'xxxxxxx',
'$or': [
{ title: {'$regex': 'aaaa', '$options': 'i'} },
{ members: { '$regex': 'aaaa', '$options': 'i'} }
],
refids: {
'$in': [
"5167cb7dd6d68b8928000001",
"5167cf6356e26a2a2b000001"
]
}
}
However I'm getting this error from mongoosejs:
ERR: [Error: Can't use $options with Array.]
While the same works in the mongodb command line (converting the object ids
to proper object
rather than strings).
Am I understanding correctly that this is a mongoosejs limitation? How to
workaround it?
I'm using mongoose 3.6.5 with nodejs 0.10.4 on ubuntu linux.
Thanks,
Alessio
--
Documentation - http://mongoosejs.com/
Plugins - http://plugins.mongoosejs.com/
Bug Reports - http://github.com/learnboost/mongoose
Production Examples - http://mongoosejs.tumblr.com/
StackOverflow - http://stackoverflow.com/questions/tagged/mongoose
Google Groups - https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm
Twitter - https://twitter.com/mongoosejs
IRC - #mongoosejs
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.