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

Unable to create index om mongo collection #2394

Closed
tirithen opened this issue Dec 6, 2019 · 1 comment
Closed

Unable to create index om mongo collection #2394

tirithen opened this issue Dec 6, 2019 · 1 comment

Comments

@tirithen
Copy link
Contributor

tirithen commented Dec 6, 2019

Maybe an old way of creating indexes is still used?

The use of system.indexes (https://github.com/vibe-d/vibe.d/blob/master/mongodb/vibe/db/mongo/collection.d#L470) is maybe not supported anymore? (https://jira.mongodb.org/browse/SERVER-10231)

Can I use the more up to date db.mycollection.createIndex() in any way instead?

My attempt to use the existing way was:

scope const(Tuple!(string, int))[] index1;
index1 ~= tuple("meta.id", 1);
collection.ensureIndex(index1);

and that gave:

vibe.db.mongo.connection.MongoDBException@/home/tirithen/.dub/packages/vibe-d-0.8.6/vibe-d/mongodb/vibe/db/mongo/connection.d(472): cannot write to 'testing.system.indexes'
@WebFreak001
Copy link
Contributor

fixed by #2433

@Geod24 Geod24 closed this as completed Jun 25, 2020
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

3 participants