mongodb-win32-i386-1.4.0
mongo-1.0.5-r1-php5.3vc6ts
From the shell I get the following output:
> use base
switched to db base
> db.productos.dropIndexes()
{
"nIndexesWas" : 2,
"msg" : "non-_id indexes dropped for collection",
"ok" : 1
}
> db.productos.ensureIndex( { "stores.coord" : "2d" })
> db.productos.getIndexes()
[
{
"name" : "_id_",
"ns" : "base.productos",
"key" : {
"_id" : 1
}
},
{
"_id" : ObjectId("4baeb1ba0e1d0000000019e8"),
"ns" : "base.productos",
"key" : {
"stores.coord" : "2d"
},
"name" : "stores.coord_"
}
]
>
> db.productos.find( {'country' : 'US'} ).limit(3).forEach(printjson)
{
"_id" : ObjectId("4baeaab3796c000000000b3f"),
"storeId" : 4,
"name" : "Minnetonka",
"longName" : "Best Buy - Minnetonka",
"address" : "13513 Ridgedale Dr",
"city" : "Minnetonka",
"region" : "MN",
"postalCode" : "55305",
"fullPostalCode" : "55305",
"country" : "US",
"stores" : [
{
"name" : "tienda 1",
"coord" : {
"x" : -5.96233,
"y" : 95.37212
}
},
{
"name" : "tienda 2",
"coord" : {
"x" : -7.45726,
"y" : 37.89522
}
},
{
"name" : "tienda 3",
"coord" : {
"x" : 0,
"y" : 0
}
}
],
"phone" : "952-544-0377",
"hours" : "Mon: 10-10; Tue: 10-10; Wed: 10-10; Thurs: 10-10;
Fri: 10-10; Sat: 9-10; Sun: 9-8"
}
{
"_id" : ObjectId("4baeaab3796c000000000b40"),
"storeId" : 5,
"name" : "Edina",
"longName" : "Best Buy - Edina",
"address" : "3200 Southdale Circle",
"city" : "Edina",
"region" : "MN",
"postalCode" : "55435",
"fullPostalCode" : "55435",
"country" : "US",
"stores" : [
{
"name" : "tienda 1",
"coord" : {
"x" : -5.96233,
"y" : 95.37212
}
},
{
"name" : "tienda 2",
"coord" : {
"x" : -7.45726,
"y" : 37.89522
}
},
{
"name" : "tienda 3",
"coord" : {
"x" : 0,
"y" : 0
}
}
],
"phone" : "952-925-4425",
"hours" : "Mon: 10-9; Tue: 10-9; Wed: 10-9; Thurs: 10-9; Fri:
9-9; Sat: 9-9; Sun: 10-7"
}
{
"_id" : ObjectId("4baeaab3796c000000000b41"),
"storeId" : 6,
"name" : "Inver Grove Heights",
"longName" : "Best Buy - Inver Grove Heights",
"address" : "1350 50th Street E",
"city" : "Inver Grove Heights",
"region" : "MN",
"postalCode" : "55077",
"fullPostalCode" : "55077",
"country" : "US",
"stores" : [
{
"name" : "tienda 3",
"coord" : {
"x" : 0,
"y" : 0
}
},
{
"name" : "tienda 3",
"coord" : {
"x" : 0,
"y" : 0
}
},
{
"name" : "tienda 3",
"coord" : {
"x" : 0,
"y" : 0
}
}
],
"phone" : "651-457-5817",
"hours" : "Mon: 10-10; Tue: 10-10; Wed: 10-10; Thurs: 10-10;
Fri: 9-10; Sat: 9-10; Sun: 10-7"
}
>
> db.productos.find( { 'stores.coord' : { $near : [ -5 , 95 ] } } ).forEach( printjson )
>
It seems well indexed, but does not return any json. Any suggestions?.
Thanks
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>