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

Indicies not updated at end of EnsureIndex( ) fn resulting in failed find operations #7

Open
davidthings opened this issue May 3, 2011 · 0 comments

Comments

@davidthings
Copy link
Contributor

In the following this code ( https://gist.github.com/952781 ) you will see I open a database, connect a key map, and ensure two indexes. Then I loop for five times creating an object then attempting to find it. This functions the first time - on a fresh database, but not on subsequent runs when the database contains data in it from a previous time. The records are not found via index, although they are there.

When I remove the reference to the second index (which is not being referred to in the code), all is well. Presumably because the index operations are done in a shorter time.

From this I concluded intially that although the object is added, the process of adding indicies was not complete by the time the function returns.

But now, I like an alternative hypothesis which is that the indicies are not completely loaded after the intial ensureIndex() call. Added a delay there fixes all subsequent loads and saves.

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

1 participant