Skip to content
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

@dcarp
Copy link
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)

@dcarp
Copy link
Contributor Author

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
Copy link
Member

BSON AAs are ordered, so that should be fine.

@dcarp
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants