ドキュメント内に位置の配列があり、その配列に 2dSpere インデックスを追加したいと考えています。それは可能ですか?
var LocationSchema = new Schema({
type: { type: String, required: true },
geometry: {
type: { type: String, required: true },
coordinates: { type: Array, required: true}
},
properties: Schema.Types.Mixed
});
// Collection to hold users
var UserSchema = new Schema({
username: { type: String, required: true, unique: true },
locations: [LocationSchema]
},{
versionKey: false
}
);
位置配列のジオメトリ フィールドに 2DSphere インデックスを追加するにはどうすればよいですか?