My collection in ArangoDb have objects with this schema (simplified):
{
"userName": "Billy",
"email": "[email protected]",
"logins": [
{
"authenticationTokens": [],
"loginProvider": "Facebook",
"providerKey": "123",
"providerDisplayName": null
}
],
"roles": [],
"claims": []
}
That's ASPNetCore.Identity implementation on ArangoDb by BorderEast aspnetcore-identity-arangodb
PROBLEM:
To auth using Facebook it uses AQL query
for u in IdentityUser for l in u.logins filter l.loginProvider == "Facebook" && l.providerKey == "123" return u
which works well but does not use any index
Indexes used:
none
I have tried indices:
db.IdentityUser.ensureIndex({ type: "hash", fields: [ "logins[*].loginProvider", "logins[*].providerKey" ] });
db.IdentityUser.ensureIndex({ type: "hash", fields: [ "logins[*].loginProvider" ] });
db.IdentityUser.ensureIndex({ type: "hash", fields: [ "logins[*].providerKey" ], unique: true });
None of them is used.
Can someone advise how the index should look like for that query?