You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
If you want to enforce that either "message" or "notes" is present then you can do it as follows.
worker_schema=intersect(
{
"_id?": ObjectId,
"worker_name": short_worker_name,
"blocked": bool,
"message?": worker_message, # old field, todo: remove this field from db if exists"notes?": intersect(
[
{"time": datetime_utc, "username": username, "message": worker_message},
...,
],
size(0, 100), # new field, todo: add this field to db if it doesn't exists
),
"last_updated": datetime_utc,
},
one_of("message", "notes"),
)
a76568a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to enforce that either "message" or "notes" is present then you can do it as follows.