Re: [mongodb-user] MongoDB multi indexing

17 views
Skip to first unread message

Sam Millman

unread,
Nov 16, 2012, 7:45:51 AM11/16/12
to mongod...@googlegroups.com
This has also been posted on da stack: http://stackoverflow.com/questions/13414630/mongodb-multi-indexing/13414980#13414980


On 16 November 2012 10:26, Marcin Rosinski <m...@feedoptimise.com> wrote:
Hi guys,

I have a quick question, do you know if mongo can create an index on the following data structure:

    {
        prices: {
            price1: 0.90,
            price2: 0.12,
            price3: 0.13
        }
    }

so I would like to do index like this `ensureIndex({prices:1})` but I am not sure will it include all prices and its values inside.

The reason why I need to lay data this way not the standard Array approach is because I would like to be able to sort based on which price version has been chosen i.e. `sort({prices.price:1})`.

Any ideas?

cheers

--
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
See also the IRC channel -- freenode.net#mongodb

Reply all
Reply to author
Forward
0 new messages