New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vibe.db.mongo.collection.MongoCollection.ensureIndex needs an ordered field_orders #824

Closed
dcarp opened this Issue Sep 12, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@dcarp
Contributor

dcarp commented Sep 12, 2014

MongoDB uses JSON object values with ordered keys so that, for ensuring compound indexes, instead of following signature:

void ensureIndex(int[string] field_orders, IndexFlags flags = IndexFlags.None)

it will be necessary something like:

void ensureIndex(Tuple!(string, int)[] field_orders, IndexFlags flags = IndexFlags.None)

@s-ludwig s-ludwig closed this in 6281f37 Sep 28, 2014

@dcarp

This comment has been minimized.

Show comment
Hide comment
@dcarp

dcarp Sep 29, 2014

Contributor

Unfortunately it is not so simple: on line 336 [1], a Bson dictionary is used that also has no key order defined.
Please reopen the issue.

[1] key[fo[0]] = Bson(fo[1]);

Contributor

dcarp commented Sep 29, 2014

Unfortunately it is not so simple: on line 336 [1], a Bson dictionary is used that also has no key order defined.
Please reopen the issue.

[1] key[fo[0]] = Bson(fo[1]);

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Sep 29, 2014

Member

BSON AAs are ordered, so that should be fine.

Member

s-ludwig commented Sep 29, 2014

BSON AAs are ordered, so that should be fine.

@dcarp

This comment has been minimized.

Show comment
Hide comment
@dcarp

dcarp Sep 29, 2014

Contributor

I didn't know that! Thanks.

Contributor

dcarp commented Sep 29, 2014

I didn't know that! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment