-
Notifications
You must be signed in to change notification settings - Fork 35
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
IN operator won't work with array variable in FilterExpression? #33
Comments
Hey there, I'm glad you are enjoying the library! At the moment, DynamoDB doesn't iterate over your list server side. If you want to search your list for an item, you'll need to do one of two things.
Feel free to ask more questions otherwise you can just close out the issue, thanks! |
Please re open this issue, if you have any other problems. Thanks! |
Is it still not supporting iterating over the list in server side? |
Does this mean that I can't query or scan on the Array of objects which I have stored in my DynamoDB? |
@praserocking same problem here,did you solve that using array ? |
@raymolin, is it still not supporting iterating over list in dynamo ? |
@divyeshdhokiya yup,here it is |
@nirmalgoswami thank you for this. This is first half of my requirement. GroupOfUsers Now I need all the rows which contains 'xyz' user. Thanks. , |
i am not sure about it |
@nirmalgoswami thanks man for your quick response. |
@nirmalgoswami Hi, I tried the query you suggested in previous comment but I am getting error while fetching data, query and error you can see here Thanks. |
You can use filter expressions to do server side filtering before the scan/query result comes back to your client. For example, if the GroupOfUsers attribute in your items is a StringSet, the filter expression contains(GroupOfUsers, :user) combined with ExpressionAttributeValues={":user":"xyz"} will only return items that have xyz in the GroupOfUsers attribute. This may require scanning a large part of the table, depending on your use case, so you might want to consider denormalizing schema so that you can use the Query operation to lessen the number of items you need to read. |
@raymolin in 2015 you said: "At the moment, DynamoDB doesn't iterate over your list server side." Alternatively, is there any plan to update the aws docs to point out that this doesn't work? IMO, it seems like a fairly obvious use case. "#foo IN (:someSet)" where :someSet is actually a set looks like it should work. At this point in time, there's nothing in the official docs warning people away from this approach. |
Has this been added yet? I'm having a difficult time understanding why this functionality wouldn't be in a db half way through 2017. I think this is a pretty common use case. |
Hi I want to query that contains a List Map object } i want to make a search where item text matches 'cd' Can you please help me out? |
Any update about this feature? |
January 2019 check-in: does anyone have a way to do this? |
so, I spent half the day to getting this working. I'm trying to reuse @ac360 's example
I only got it working with declaring every element in the "IN" clause independently. Now you want to automate this, so I came up with this.
hope that helps |
Hi, i made a simple workaround for the
this method will return the Hope it helps anyone stuck in handling arrays with |
2023 and this still not working.... |
First off, great library. Thank you!
I've got this array:
var client_ids = ["data_8109"];
and I'm putting it into the FilterExpression function with anIN
operator, but the query is not locating the record. If I don't use the array variable and hardcode the single client_id in, it shows up. Is my syntax missing something?The text was updated successfully, but these errors were encountered: