In this tutorials we will learn how to Rename mongoDB Collection using db.collection.renameCollection(target, dropTarget) method.
In this tutorials we will learn how to grant roles to user. db.grantRolesToUser() - method grants additional roles to a user account. Refer following db.grantRolesToUser() method syntax.
In this tutorial we will learn how to create Index on collection using mongodb db.collection.createIndex() method.
db.isMaster() - method returns document that describes the role of the mongod instance. If the instance is a member of a replica set, then isMaster returns a subset of the replica set configuration and status including whether or not the instance is the primary of the replica set. Refer following db.isMaster() method syntax.
In this tutorial we will learn how to get underlying system information on which mongod or mongos runs using db.hostInfo() command.
In this tutorial we will learn how to drop database using mongoDB shell command.
In this tutorial we will learn how to drop mongoDB collection from the database.
In this tutorial we will learn how to create new collection with different options, Capped collection, collection with document validation option. Use db.createCollection(name, options) method to create new collection in the database.
In this tutorial you will learn how to count number of documents in the collection. mongoDB db.collection.count() method is used to get the count of documents.
In this tutorial we will learn how to create an auto increment sequence field using mongoDB. MongoDB creates a unique index on the _id field while creating collection. By default mongoDB uses standard auto generated ObjectId to maintain the sequence / uniqueness for _id field in the document.