Creating multiple geoHaystack indexes

66 views
Skip to first unread message

darachides

unread,
Dec 2, 2011, 10:46:47 PM12/2/11
to mongodb-user
How can I create multiple geoHaystack indexes with differing
bucketSizes on the same set of two key?

My keys are {coordinates: Array, category: String}. I ran the
following commands on the mongo shell:

> db.test_models.ensureIndex({coordinates : "geoHaystack", category : 1 }, { bucketSize : 0.1 })
> db.test_models.ensureIndex({coordinates : "geoHaystack", category : 1 }, { bucketSize : 0.01 })

The first one creates an index. The second one doesn't seem to do
anything (db.test_models.getIndexes() just returns the first index),
even if I provide an index name.

Is this a mongo bug?

Eliot Horowitz

unread,
Dec 3, 2011, 12:00:45 AM12/3/11
to mongod...@googlegroups.com
No - you can't have 2 indexes with the same fields and different bucket sizes.
can file a feature request @ http://jira.mongodb.org/

> --
> 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.
>

darachides

unread,
Dec 3, 2011, 1:38:14 AM12/3/11
to mongodb-user

On Dec 2, 9:00 pm, Eliot Horowitz <el...@10gen.com> wrote:
> No - you can't have 2 indexes with the same fields and different bucket sizes.
> can file a feature request @http://jira.mongodb.org/

Feature request added: https://jira.mongodb.org/browse/SERVER-4420

Reply all
Reply to author
Forward
0 new messages