Fetch fields starting with 2 particular substring in mongodb using springboot?
I'm trying to find all the documents with first name starting with Ram or Shyam. I tried the following which actually worked in mongoDb db.collection.find({ $or: [ { name: { $regex: "^Ram" } }, { "name": { "$regex": "^Shyam" }…