Answers for "match document that contain some strings mongodb"

1

contains mongo-query string

db.users.findOne({"username" : {$regex : ".*son.*"}});
Posted by: Guest on October-21-2020
0

mongodb check if substring in string

#all documents whose description field contains anywhere
#in the text the "beach" sub string
query = db.collection.find({
  "description" : {"$regex" : ".*beach.*"}
})
Posted by: Guest on February-25-2021

Code answers related to "match document that contain some strings mongodb"

Python Answers by Framework

Browse Popular Code Answers by Language