MongoDB
Indeks 2dsphere
Szukaj…
Utwórz indeks 2dsphere
db.collection.createIndex() służy do utworzenia indeksu 2dsphere . 2dsphere indeksu 2dsphere :
db.collection.createIndex( { <location field> : "2dsphere" } )
Tutaj location field jest kluczem, a 2dsphere jest rodzajem indeksu. W poniższym przykładzie 2dsphre indeks 2dsphre w kolekcji places .
db.places.insert(
{
loc : { type: "Point", coordinates: [ -73.97, 40.77 ] },
name: "Central Park",
category : "Parks"
})
Poniższa operacja utworzy indeks 2dsphere w polu loc zbioru places .
db.places.createIndex( { loc : "2dsphere" } )
Modified text is an extract of the original Stack Overflow Documentation
Licencjonowany na podstawie CC BY-SA 3.0
Nie związany z Stack Overflow