Empty index array not considered unique in multi-term index

Thanks, but this doesn’t guarantee uniqueness of the index, correct? I might end up with multiple documents with the same set of tags. Intuitively it also feels like running three indexes would be less performant than the one with the index bindings, wouldn’t it? This is a read-dominated collection, where I would expect each index to be read a few times a day, but only written to less than once a month.

Perhaps you already saw it, but I was musing the best pattern for my use-case over in this over thread: FQL Query for Prefix of Search term

I’ve opened this separate thread because I think there’s a bug in the case of a unique index which uses an array as a secondary term. Here’s an even simpler example that doesn’t use bindings:

CreateIndex({
name: 'foos_by_tag',
source: Collection("foos"),
terms: [
  { field: ['data', 'user'] },
  { field: ['data', 'tags'] }
],
unique: true,
serialized: true,
})
Create("foos", { data: { user: "john", tags: [] } } )
Create("foos", { data: { user: "john", tags: [] } } ) // error: instance not unique

I believe that the error is a bug, and that I should be able to create a second document using this index. Do you disagree?