zeppelin-mongodb-interpreter
zeppelin-mongodb-interpreter copied to clipboard
$regex doesn't work in find or aggregate
My mongodb version is 3.2 (and i am using your docker image)
code that return nothing (but works in my mongo shell) : %mongodb db.getCollection('getMongoData').find({"output.ns" : {"$regex":'total.authentification'}}).table()
code that work : a table is displayed %mongodb db.getCollection('getMongoData').find({"output.ns" :'total.authentification'}).table()
Any idea why $regex doesn't work?
Regards, Sylvain G.
if i pass by a variable, instead of function table(), it's working :
%mongodb var result = db.getCollection('getMongoData').find({"output.ns": {$regex: 'total.authentification'}})
// Build a 'table' print("%table host\tns") result.forEach(state => { print(state.host + "\t" + state.output.ns) })
Hello,
I've tried a regex query with the docker image and I got the right result.
And if you try your query in the mongo shell, you get what you want ?