Can we create unique index to eliminate duplicate in couchbase like primary index in SQL

index

#1

Is there any way to create unique index to eliminate duplicate in couchbase like primary index in Sql?
If suppose we want to eliminate insertion of duplicate records, what index we need to create for the same.


#2

Couchbase document key must be unique. https://developer.couchbase.com/documentation/server/3.x/developer/dev-guide-3.0/keys-values.html

On the fields you can create secondary index but NOT unique index or constraints. You can use the same field as document key and achieve what you are looking