How do you find if a property that is an array contains a value, what is available by default to Xodus is txn.find(entityType, propertyName, comparableValue)
to find a value, however, what is the best way to find if an array property contains a value. Suppose I have this:
public class EmbeddedArrayIterable implements Serializable, ByteIterable {
}
In which I need to compare if a given value, example "cat", is inside the array. What should be the implementation of EmbeddedArrayIterable
as such it will be able to return the Entity
to which this "cat" string is in the array of the entity.
As such we can do:
// This property is a `EmbeddedArrayIterable`
// which is a serialized JSON like `["cat","tiger","lion"]`
String propertyName = "keywords";
String comparableValue = "cat";
EntityIterable cats = txn.find(entityType, propertyName, comparableValue);