How to see first records of a collection in CLI

Hi ! How can I display the first documents of a collection in cli ?
Without having to use the query sandbox or shell ?

“First documents” is a little difficult to define clearly; the documents aren’t stored in FIFO order.

If you have a Query service you could use a direct request to the REST API to run a suitable SELECT statement (typically using curl). Perhaps something like: SELECT * FROM myBucket.myScope.myCollection LIMIT 5

If you know specific document keys, cbc cat can retrieve them. (Also see this.)

HTH.

It worked well with cbq and the cli version of the query with --script=query argument. Thank you very much for your answers