We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e00ed43 commit 66a40aeCopy full SHA for 66a40ae
1 file changed
server/src/collection.rs
@@ -229,7 +229,16 @@ impl Collection {
229
let mut items = Vec::new();
230
231
for item in self.items.lock().await.iter() {
232
- if item.attributes().await == *attributes {
+ let item_attributes = item.attributes().await;
233
+
234
+ // Check if the (key, value) pairs in the requested attributes are
235
+ // a subset of the attributes in the item being checked for in the
236
+ // collection.
237
+ let attributes_are_subset = attributes
238
+ .iter()
239
+ .all(|(key, value)| item_attributes.get(key) == Some(value));
240
241
+ if attributes_are_subset {
242
items.push(item.clone());
243
}
244
0 commit comments