In mongodb, we can use db.collection.getIndexes()
to get all indexes, output is something like:
[
{
"v" : 2,
"key" : {
"_id" : 1
},
"name" : "_id_",
"ns" : "counters"
}
]
Most properties are pretty self-explanatory except for "v", can't seem to find any documentation about this. Does any one know what "v" means here? Thank in advance.
The __v field is called the version key. It describes the internal revision of a document. This __v field is used to track the revisions of a document. By default, its value is zero ( __v:0 ).
To support efficient queries of geospatial coordinate data, MongoDB provides two special indexes: 2d indexes that uses planar geometry when returning results and 2dsphere indexes that use spherical geometry to return results.
collection. totalIndexSize() 4617080000. The above example shows an index size of almost 4.3 gigabytes. To ensure this index fits in RAM, you must not only have more than that much RAM available but also must have RAM available for the rest of the working set.
Index Key The total size of an indexed value must be less than 1024 bytes. MongoDB will not add that value to an index if it is longer than 1024 bytes. Using db. collection.
v
is the version.
Version 0 has been disallowed since MongoDB 3.2,
I have heard that only version 2+ can be used with MongoDB 4.2, but I am unable to find a documentation link to confirm that.
See also: https://docs.mongodb.com/manual/core/2dsphere/#versions https://docs.mongodb.com/manual/core/index-text/#versions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With