This should do it
var UserInfo = new Schema({
username : String,
password : String
}, { collection: 'userinfo' });
See this link from the Mongoose documentation for more information.
More Related Contents:
- MEAN app vs. Mongo service local in Angular2
- Does MongoDB’s $in clause guarantee order
- Find document with array that contains a specific value
- What’s Mongoose error Cast to ObjectId failed for value XXX at path “_id”?
- Node.js Mongoose.js string to ObjectId function
- pushing object into array schema in Mongoose
- arrayFilters in mongodb
- How do you use Mongoose without defining a schema?
- How to access a preexisting collection with Mongoose?
- How do I query for distinct values in Mongoose?
- Creating Multifield Indexes in Mongoose / MongoDB
- MongoDB password with “@” in it
- Unhandled promise rejection: Error: URL malformed, cannot be parsed
- How to return Mongoose results from the find method?
- MongoDB: output ‘id’ instead of ‘_id’
- How can I update multiple documents in mongoose?
- MongoDB: Calculate dwell time between every status value change
- MongoDB: how to parse date in 3.6 mongoDb version?
- Dealing with schema changes in Mongoose
- Does Mongoose support the Mongodb `findAndModify` method?
- Image returned from REST API always displays broken
- Delete a key from a MongoDB document using Mongoose
- Mongoose limit/offset and count query
- Mongodb aggregation $group, restrict length of array
- Mongoose.js instance.save() callback not firing
- Fuzzy Searching with Mongodb?
- MongoDB via Mongoose JS – What is findByID?
- $project in $lookup mongodb
- MongoDB count() versus countDocuments()
- Mongodb, aggregate query with $lookup