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

Find query does not return the cloudant bookmark field #3

Closed
flam312 opened this issue Feb 23, 2016 · 8 comments
Closed

Find query does not return the cloudant bookmark field #3

flam312 opened this issue Feb 23, 2016 · 8 comments

Comments

@flam312
Copy link

flam312 commented Feb 23, 2016

I am using the loopback model find function with the loopback-connector for cloudant. The number of models returned are always <= 200. Upon further investigation I found that this is a limitation imposed by cloudant's query.

https://developer.ibm.com/answers/questions/233525/nodered-cloudant-using-cloudant-node/
https://docs.cloudant.com/cloudant_query.html#finding-documents-using-an-index

The bookmark field is used to for paging through the result sets each of which being a max of 200 rows.

When debugging the Find matching model instances by filter code in lib\cloudant.js it looks like the query results return both a doc and bookmark field. However, the results.doc is the only thing that is callback.

Is there a way to have a filtered query result of greater than 200 or use the bookmark to page through in the current connector implementation?

@bwghughes
Copy link

@flam312 Any update on this - did you find a work around?

@flam312
Copy link
Author

flam312 commented Mar 2, 2016

@bwghughes I did find a work around by using the loopback skip filter.

https://docs.strongloop.com/display/public/LB/Skip+filter

I basically have a recursive function that executes the same query using the skip filter to page through the results. However, I feel that the connector should be doing this and returning the total amount for us.

@snowch
Copy link

snowch commented Mar 2, 2016

@tonyffrench +1 for resolving this defect as discussed offline today.

@tonyffrench
Copy link
Contributor

Cloudant Query search limits by design the number of documents returned to 200. I'm investigating a way to surface the bookmark feature. Another alternative maybe to switch between text search vs json search.

@jmereaux
Copy link

jmereaux commented Mar 3, 2016

+1 For updating the connector so that it returns the whole list of documents if there's more than 200

@zamrokk
Copy link

zamrokk commented Mar 3, 2016

👍

@noxxious
Copy link

noxxious commented Mar 3, 2016

+1 here as well.

@tonyffrench
Copy link
Contributor

Version 1.0.5 should now be out on NPM

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

7 participants