You can do it with the following code.
db.users.findOne({"username" : {$regex : "son"}});
More Related Contents:
- Authentication failure while trying to save to mongodb
- Possibility of duplicate Mongo ObjectId’s being generated in two different collections?
- Converting string to date in mongodb
- MongoDB wildcard in the key of a query
- Auto increment in MongoDB to store sequence of Unique User ID
- MongoDB Aggregation: How to get total records count?
- Average Aggregation Queries in Meteor
- How to query MongoDB to test if an item exists?
- Working with special characters in a Mongo collection
- Mongo sort on a calculated condition
- MongoDB: output ‘id’ instead of ‘_id’
- MongoDB: Updating subdocument
- MongoDB $gt/$lt operators with prices stored as strings
- MongoDB: Calculate dwell time between every status value change
- How to export all collections in MongoDB?
- Couldn’t connect to server 127.0.0.1:27017
- Is GridFS fast and reliable enough for production?
- Dealing with schema changes in Mongoose
- Batch insert/update using Mongoid?
- Using stored JavaScript functions in the Aggregation pipeline, MapReduce or runCommand
- MongoDB – The argument to $size must be an Array, but was of type: EOO / missing
- How to flatten a subdocument into root level in MongoDB?
- How to access overall document count during arithmetic aggregation expression
- How to deal with the timezone issue when storing dates in utc using mongod?
- Fuzzy Searching with Mongodb?
- Insert json file into mongodb
- Clone a collection in MongoDB
- Modify and replay MongoDB oplog
- Return actual type of a field in MongoDB
- Sort nested array of objects