When we have used or specifies collation in a distinct method, we need to specify a mandatory locale to define the field with collation in a distinct method.This will return only distinct data from the collection, if in one collection thousands of documents and we need only those documents which were distinct each other same time we have used distinct in MongoDB.The distinct method in MongoDB uses an index on the field while doing a distinct operation on collection.The query is a handy and important parameter in a distinct method.īelow is the working of distinct command: Query: Query distinct method defines the document from which we have to retrieve the collection’s distinct value.It is available only if the document specifies the options. This is an additional option used in the distinct command. Options: This is an optional parameter in MongoDB distinct command. ![]() The field is an essential and useful parameter in a distinct method. ![]() Field: Field has specified that return distinct value from the field we have specified with distinct methods.This is used to retrieve distinct values from the collection. This is very important and useful to retrieve distinct data from a single collection. Distinct: This will return only distinct data from the collection.We can retrieve distinct values from the collection by using distinct methods. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |