MongoDB Indexes

3 views
Skip to first unread message

Rafael Sierra

unread,
Nov 13, 2010, 11:00:50 PM11/13/10
to typhoonae
Hi guys, I'm now using typhoonae-trunk, unfortunally appcfg isn't
working to update my code, I will introspect it later to findout what
is the problem and try to fix it. But this is not my major problem
right now.

Let's say I have the following lines into index.yaml:

----------------------------
- Kind: MyModel
properties:
- name: foo
- name: bar

- Kind: MyModel
properties:
- name: foo
direction: desc
---------------------------

So if I want to create those indexes into mongodb, the correct command would be:

> db.MyModel.ensureIndex({foo:1, bar:1})
> db.MyModel.ensureIndex({foo:-1})

Right?


--
Rafael Sierra
http://blog.rafaelsdm.com

Tobias

unread,
Nov 14, 2010, 4:48:53 AM11/14/10
to typhoonae
Hi Rafael,

On Nov 14, 5:00 am, Rafael Sierra <rafaeljs...@gmail.com> wrote:
> Hi guys, I'm now using typhoonae-trunk, unfortunally appcfg isn't
> working to update my code, I will introspect it later to findout what
> is the problem and try to fix it. But this is not my major problem
> right now.

What's happening if you try to upload your code to TyphoonAE using the
appcfg.py command?

> Let's say I have the following lines into index.yaml:
>
> ----------------------------
> - Kind: MyModel
>  properties:
>  - name: foo
>  - name: bar
>
> - Kind: MyModel
>  properties:
>  - name: foo
>  direction: desc
> ---------------------------
>
> So if I want to create those indexes into mongodb, the correct command would be:
>
> > db.MyModel.ensureIndex({foo:1, bar:1})
> > db.MyModel.ensureIndex({foo:-1})
>
> Right?

Absolutely, yes.

- Tobias
Reply all
Reply to author
Forward
0 new messages