Hello:
It looks like in mongodb shell, it would recognize
db.collection.find({rsid: /rs980|rs755/})
there were 3 rows returned.
However, it would not recognize
db.collection.find({rsid: "/rs980|rs755/"})
While in java, I used
DBObject query = new BasicDBObject("rsid", "/rs980|rs755/");
dbtable.find(query)
it generated no return. I suspect it considered "/rs980|rs755/" as
string instead of
regular expression. I have tried
DBObject query = new BasicDBObject('rsid", new
BasicDBObject("$regex", "/rs980|rs755/")), it does not help, neither.
Could you tell me what I had done wrong? Thanks!