MongooseJSで次の種類のクエリを実行すると:
Place
.find({location:{$geoWithin:{$box:[[0, -40],[151.0983703,-33.8674744]]}}})
.exec(function(err, places) {
...
});
結果がゼロで、次のメッセージがerr
[エラー: 配列で $geoWithin を使用できません。]
それでも、MongoDB に対してまったく同じ条件をコマンド ラインで直接実行すると、次のようになります。
> db.places.find({location:{$geoWithin:{$box:[[0, -40],[151.0983703,-33.8674744]]}}})
出力に表示されるレコードの正しいリストを取得します。
MongooseJS コードのどこが間違っていますか?