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

bug, index error #7

Open
chensanle opened this issue Oct 25, 2019 · 1 comment
Open

bug, index error #7

chensanle opened this issue Oct 25, 2019 · 1 comment

Comments

@chensanle
Copy link

chensanle commented Oct 25, 2019

when I used index like “create_time.seconds” as a cursor field to query data, the program can't get the correct next page token, see the source code:

cursorData[i] = bson.DocElem{Name: cf, Value: doc[cf]}

It just assign "create_index.seconds" to doc and matching doc map, I think it should be look like this:

if cf == "create_time.seconds" {
    sonM, _ := doc["create_time"].(bson.M)
    cursorData[i] = bson.DocElem{Name: cf, Value: sonM["seconds"]}
} else {
    cursorData[i] = bson.DocElem{Name: cf, Value: doc[cf]}
}

Just a example~

@icza
Copy link
Owner

icza commented Oct 29, 2019

Can you provide a minimal, complete example that reproduces the issue you're having? Showing data models, example documents in MongoDB, how you query documents, what indices you have etc.

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