minquery
minquery copied to clipboard
bug, index error
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~
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.