0
votes

I am new to couchbase lite db. I am using it with ionic v1. I have created many documents with key parameter as id and name. I have list of companies and employees associated with each company. Lets say Company A has 10 of employees and Company B has 5 employees.

Documents are store with two key parameters as id of company and name of employee. Also, as I have given name as second param in key it is in sorted form.

so there are many documents which are with same id and different name. I wanted to retrieve documents with one specific id lets say 1 . If I fire query it should only give me employees of company 1. Also, it should be in sorted form.

I am trying to use start_key,end_key and prefix match level.but I am not successful in it.

Help will be appreciable.

1

1 Answers

0
votes

startkey=[1]&endkey=[1,{}]&prefix_match_level=2

is the solution for this.

Hope this will help someone.