Today, we can create this kind of index:
{"index":{"fields":["dir_id","type","name"],"partial_filter_selector":{"_id":{"$nin":["io.cozy.files.trash-dir","io.cozy.files.shared-drives-dir"]},"path":{"$or":[{"$exists":false},{"$nin":["/Settings"]}]}}},"ddoc":"by_dir_id_and_type_and_name_filter_(_id_$nin_(io.cozy.files.trash-dir_io.cozy.files.shared-drives-dir))_and_(path_($exists_false)_$or_($nin_(/Settings)))"}
because we have this kind of selector:
`{"selector":{"dir_id":"io.cozy.files.root-dir","type":"directory","name":{"$gt":null},"_id":{"$nin":["io.cozy.files.trash-dir","io.cozy.files.shared-drives-dir"]},"path":{"$or":[{"$exists":false},{"$nin":["/Settings"]}]}},"use_index":"_design/by_dir_id_and_type_and_name_filter_(_id_$nin_(io.cozy.files.trash-dir_io.cozy.files.shared-drives-dir))_and_(path_($exists_false)_$or_($nin_(/Settings)))","limit":100,"skip":0,"sort":[{"dir_id":"asc"},{"type":"asc"},{"name":"asc"}]}`
So the generated index name is:
_design/by_dir_id_and_type_and_name_filter_(_id_$nin_(io.cozy.files.trash-dir_io.cozy.files.shared-drives-dir))_and_(path_($exists_false)_$or_($nin_(/Settings)))
It works with Couch 3.3.3, but it breaks with Couch 3.5.1 because of the "/". We should sanitize the index name.
Today, we can create this kind of index:
because we have this kind of selector:
So the generated index name is:
It works with Couch 3.3.3, but it breaks with Couch 3.5.1 because of the "/". We should sanitize the index name.