Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataconnect query with String_Pattern doesnt work. uknown key pattern #7943

Open
artanisdesign opened this issue Nov 13, 2024 · 2 comments
Open
Assignees
Labels
api: dataconnect Issues related to dataconnect type: feature request

Comments

@artanisdesign
Copy link

artanisdesign commented Nov 13, 2024

Environment info

firebase-tools: 13.25.0

Platform: mac

Test case

query getItemsByName($regex: String) { matchRegex: items(where: {title: {pattern: {regex: $regex}}}){ title } }

Steps to reproduce

i just run this query in the console

Expected behavior

list items with title that matches regex

Actual behavior

"message": "(where.title: String_Filter): unknown key pattern",

@artanisdesign artanisdesign changed the title data-connect query with String_Pattern doesnt work. data-connect query with String_Pattern doesnt work. uknown key pattern Nov 13, 2024
@artanisdesign artanisdesign changed the title data-connect query with String_Pattern doesnt work. uknown key pattern dataconnect query with String_Pattern doesnt work. uknown key pattern Nov 13, 2024
@argzdev argzdev added api: dataconnect Issues related to dataconnect type: bug and removed type: bug labels Nov 14, 2024
@joehan
Copy link
Contributor

joehan commented Nov 15, 2024

Hey @artanisdesign - sorry for the inconvenience here. I just checked, and it looks like the documentation for this feature went out before it was actually implemented. It should be coming soon, but for now I'm going to remove it from the docs (https://firebase.google.com/docs/reference/data-connect/gql/input_object#String_Filter)

If there is somewhere else that you noticed this documented, please let me know!

In the meantime, I'd recommend using contains instead to implement similar operations - ie:

query getItemsByName($name: String) { matchRegex: items(where: {title: {contains: $name}}){ title } }

@artanisdesign
Copy link
Author

hi @joehan thanks for the reply.

yea.. i've been using contains.. problem is with that one its case sensitive.. so basically i had to create a searchstring property.. which is lowercase.. to make contains work. not ideal.. but i guess will have to do until pattern becomes available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dataconnect Issues related to dataconnect type: feature request
Projects
None yet
Development

No branches or pull requests

4 participants