Hello, could anyone look at my query to see if it is the issue, or I should report an issue with storage itself.
I’m not able to query by index. When I query by key, it works fine, but when I use index it doesn’t work, here is an example:
Storing test data (it works fine most probably):
const queryResponse = await storage.entity('similar_ideas').set('test_key2', {
project: 'test_project1',
project_two: 'test_project_two2',
is_same_project: false,
pair_one: 'test_pair_one2',
pair_two: "test_pair_two2",
score: 0.5
});
Querying test data by key:
const queryResponse = await storage.entity("similar_ideas").get('test_key2');
Response (I get my stored my value back):
{"score":0.5,"pair_one":"test_pair_one2","project_two":"test_project_two2","pair_two":"test_pair_two2","project":"test_project1","is_same_project":false}
So far so good…
But when I query by index (for example “project” index)
const queryResponse = await storage
.entity("similar_ideas")
.query()
.index('project')
. where(WhereConditions.equalsTo("test_project1"))
.getMany()
Response:
{"results":[],"nextCursor":null}
Or if I query using getOne() I get “undefined”
Do you have an idea if it is the way I construct query or store data or it is another issue with storage API or something similar?