cognitom / momy

MongoDB to MySQL replication
https://www.npmjs.com/package/momy
MIT License
98 stars 37 forks source link

ns field has bson.D value that is not string or valid MongoDb #19

Open nloui opened 7 years ago

nloui commented 7 years ago

Thanks for this great work!! I'm getting this error, has anyone seen it?

name: 'MongoError', message: 'ns field has bson.D value that is not string or valid MongoDb RegEx: Error parsing value [{$in [db.collection db.collection2 db.collection2]}] to RegEx: Must specify $regex field', ok: 0, errmsg: 'ns field has bson.D value that is not string or valid MongoDb RegEx: Error parsing value [{$in [db.collection db.collection2 db.collection2]}] to RegEx: Must specify $regex field', code: 8000, codeName: 'AtlasError' }

bhanwarc commented 5 years ago

@nloui did you got any fix for this issue?

bhanwarc commented 5 years ago

I got the solution The Query is using the "$in" and "$nin", instead of using $in or $nin need to use the $regex, I tried with $regex, it fetching proper data

db.oplog.rs.find({ns:{$regex:"^ORG_DB."}}).pretty() this is working but if using the $in or $nin it retuns the ns field has bson.D value that is not string error which is kind of type miss matching error