Sindre Røkenes Myren
Sindre Røkenes Myren
I don't see any reason why this feature could not be added. Please do feel free to create a PR for it. > I am using Mongo DB as storage,...
> $not-ing a whole expression since that seems a b To be honest, I am not sure how _useful_ it is to be able to not the whole expression. The...
So at least I am not against _only_ implement `$not` as an oposite to `$regex`. An views from you @rs? For reference: https://docs.mongodb.com/manual/reference/operator/query/not/
PS! It would be the user's responsibility to make sure that fields do not overlap between the different all-off members. E.g. if specifying a `&schema.AllOf{&schema.Dict{...}, &schema.Object{...}}`, and both the dict...
Commenting although you are still editing the post. I wold recommend solving the TTL on a database level based on your TTL field. For MongoDB, check out https://docs.mongodb.com/manual/core/index-ttl/
Assuming a Nullable timestamp field in the DB named `deleteAt` in the schema, you cold have a goroutune that does a `Clear` with filter `{deleteAt:{$lt: now}` at a reasonable interval.
Pseudo code for the filter...
Doesn't setting the field `ReadOnly: true` work? The resource hook can still update the field as it happens post schema validation.
You are right 🤦♂️ My mistake. There are some work-around for setting read-only fields but it's not available to the hook. It's used e.g. when setting fields from the path:...
Longer term, I plan to have a look at this here: https://github.com/searis/schema. However I cannot commit to any particular timeline for this now. Probably nice to come up with a...