A worked example, rendered from real sample data. Sign in to run the tool on your own input.
{"name":"Ada","age":">30","roles":["admin","editor"],"city":"~london","inactive":null}db.collection.find({
"name": "Ada",
"age": {
"$gt": 30
},
"roles": {
"$in": [
"admin",
"editor"
]
},
"city": {
"$regex": "london",
"$options": "i"
},
"inactive": {
"$exists": false
}
})
Convert flat key-value JSON into a MongoDB find() query object. Part of the DevTools Surf developer suite. Browse more tools in the Converters collection.