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

iter obj skip limit keyword unexpected results #248

Open
featherduino opened this issue Feb 22, 2023 · 5 comments
Open

iter obj skip limit keyword unexpected results #248

featherduino opened this issue Feb 22, 2023 · 5 comments

Comments

@featherduino
Copy link

Error: Failed to send "getMore" command with database
Failed to read 7028797 bytes: socket error or timeout

@jeroen
Copy link
Owner

jeroen commented Feb 22, 2023

Did you try the iterator: https://jeroen.github.io/mongolite/query-data.html#iterating

@featherduino
Copy link
Author

Yup this is after using the iterator

Stored the iter obj in a variable

Then appended in a list using iter$one command

@featherduino
Copy link
Author

featherduino commented Feb 23, 2023

z<-list()
it<-temp_stats$iterate(query='{"action": "CREATE_POST","_id": {"$gt": {"$oid":"63ebd3280000000000000000"}}}',limit=5000,skip = 1000)
while(!is.null(it$one())){
 rlist::list.append(z,it$one())
}

FYI

@featherduino
Copy link
Author

featherduino commented Feb 23, 2023

okay i got this to work but am getting half the records which is surprising
count of records for query in DB ~ 50 K
I get 23K

@featherduino
Copy link
Author

There seems to be a bug because when i used
it<-temp_stats$iterate(query='{"action": "CREATE_POST","_id": {"$gt": {"$oid":"63ebd3280000000000000000"}}}',skip = 26885)

I get 40k rows including the first 1000 ones when i did not add skip

@featherduino featherduino changed the title cannot query more than 5000 rows how to query iter obj skip limit keyword unexpected results Feb 23, 2023
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