Default

The default property assigns a predefined value when none is specified, or it can be enforced by omitting values from the post.

...
{
   "schema": {
        "user": {
            "type": "string",
            "default": "$.auth._id"
        },
		"publishedAt": {
			"type": "number",
			"default": "$.now"
		},
		"ip": {
			"type": "string",
			"default": "$.ip"
		},
        "title": {
            "type": "string"
        },
		"rate": {
			"type": "number",
			"default": 0
		}
    },
}
...

The $.auth._id value refers to the authenticated user's unique identifier (ID).

The $.now value represents the current timestamp at the time the request is made.

The $.ip value refers to the IP address of the client making the request.

Edit this page on Github
© 2025 kav3.com. Crafted with and dedication.