-
With the hyper63 client add the ability to specify a document schema using A potential implementation would look like this
const z = require('@hyper63/schema')
module.exports = z.object({
id: z.string(),
type: z.enum(['movie']),
title: z.string(),
year: z.string().min(4).max(4)
})
const createClient = require('@hyper63/client')
const client = createClient(config)
const movieSchema = require('../core/movies/schema')
client.setup.db({types: [
{name: 'movie', cache: true, schema: movieSchema },
{name: 'actor', cache: true },
{ name: 'producer', cache: false}
]}) By adding an optional schema property to the db setup, we could validate each doc, via schema on create, update, and get. |
Beta Was this translation helpful? Give feedback.
Answered by
twilson63
Feb 18, 2021
Replies: 1 comment
-
I think we should hold on this feature request, I think it is too soon. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
twilson63
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think we should hold on this feature request, I think it is too soon.