I am using Marklogic 7 Rest API and I want to find out the number of documents in any collection in my Marklogic database. How can this be achieved?
Asked
Active
Viewed 349 times
1 Answers
2
You can POST a query on the collection with a page length of 1:
{"query": { "queries": [{ "collection-query": { "uri": ["YOUR_COLLECTION"] } }] }}
http://docs.marklogic.com/REST/POST/v1/search
http://docs.marklogic.com/guide/search-dev/structured-query#id_76890
The total property in the search response will indicate the number of documents in the collection.

ehennum
- 7,295
- 13
- 9