I want to know if there is a way to perform a N1QL search across entire bucket (all documents) to locate a specific data. Example: I want to find all documents containing the number 123456.
The number may appear under different keys.
BTW, I’m sure it will be extremely slow and not efficient , but I don’t mind it.
Thanks a lot,
Daniel.
Thank you for the quick response.
When I run it I’m getting error code 404 and the following error:
[
{
“code”: 4000,
“msg”: “No index available on keyspace default that matches your query. Use CREATE INDEX or CREATE PRIMARY INDEX to create an index, or check that your expected index is online.”,
“query_from_user”: “SELECT META(d).id\nFROM default AS d\nWHERE ANY v WITHIN d SATISFIES v = 14517862 END;”
}
]
You can try this. Index size might be too big because every field is indexed.
CREATE INDEX ix11 ON default(DISTINCT ARRAY v FOR v WITHIN self END);
SELECT META(d).id
FROM default AS d
WHERE ANY v WITHIN d SATISFIES v = 123456 END;