Closed thantos closed 1 year ago
Between should be an array.
between: [start,end]
Do the types properly protect from having two subsequent startsWith, between, etc?
Do the types properly protect from having two subsequent startsWith, between, etc?
Yeah. The query key condition can only be on the current head of the recursive progressive query key type. Also only on sort attributes.
I wonder if we should adopt mongo's syntax so that we are not inventing as much. They use $gt, $gte, etc. this same query language can then be used in filter expressions too.
https://www.mongodb.com/docs/manual/tutorial/query-documents/
I wonder if we should adopt mongo's syntax so that we are not inventing as much. They use $gt, $gte, etc. this same query language can then be used in filter expressions too.
https://www.mongodb.com/docs/manual/tutorial/query-documents/
Alright, I've been thinking about this.
At first I didn't think we needed any special characters because there is no ambiguity, and then I thought about adding $or
logic, but dynamo key conditions cannot support $or
.
BUT, if we want to support a DSL for filtering logic and not an expression, we'll need $or
on the object to support complex filter queries.
// val < 100 && (begins_with(val2, "a") || begins_with(val2, "b"))
{
val: { $lt: 100 },
$or: [{
val2: { $beginsWith: "a" }
}, {
val2: { $beginsWith: "b" }
}[
}
I'll make the change
updated docs: https://github.com/functionless/eventual-website/pull/16
Adds the ability to provide query conditions in place of concrete key attributes for the sort key.
Caveats:
["name", "age"]
,{ name: "sam", age: { $gt: 30 } }
- greatThan 30 will use string based "30" and not numericTODO: add documentation