Closed onurdialpad closed 4 days ago
Note, datastore emulator with arg --use-firestore-in-datastore-mode works when I post IN filter with single element, payload is
{'kind': [{'name': 'QueryTestEntity'}], 'filter': {'propertyFilter': {'op': 'IN', 'property': {'name': 'str_prop'}, 'value': {'excludeFromIndexes': False, 'arrayValue': {'values': [{'excludeFromIndexes': False, 'stringValue': 'foo'}]}}}}, 'limit': 100}
Hi @onurdialpad, the Datastore emulator does not support the new query features even for datastore mode, hence why you see that exception.
Hi @harshyyy21, thanks for the answer. I thought It is supposed to work with IN filter, since It works with or without --use-firestore-in-datastore-mode
when I pass
{'kind': [{'name': 'QueryTestEntity'}], 'filter': {'propertyFilter': {'op': 'IN', 'property': {'name': 'str_prop'}, 'value': {'excludeFromIndexes': False, 'arrayValue': {'values': [{'excludeFromIndexes': False, 'stringValue': 'foo'}]}}}}, 'limit': 100}
to datastore emulator. As far as I know IN filter is something new Firestore supports. Am I missing something?
When IN was added to Datastore Mode, it was never backfilled into the Datastore Emulator. The query above is essentially an equality with a single value, but as soon as you add multiple values in the array, it will fail with or without the --use-in-firestore-in-datastore-mode
flag. IN along with the other new query features are only available via the Firestore emulator.
Thanks, closing this then.
[REQUIRED] Environment info
firebase-tools: 13.11.3
Platform: macOS
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
1 - run the
datastore emulator
as2 - Execute the test code shared above
[REQUIRED] Expected behavior
firestore emulator in datastore mode returns the response below when I execute it with a command:
[REQUIRED] Actual behavior
It returns http status code 400 with error message