@zodyac/zod-mongoose 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ First, create your zod schema:
|
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
20
|
import { z } from 'zod';
|
|
21
|
-
import { zId } from '@zodyac/zod-mongoose';
|
|
21
|
+
import { zId, zUUID } from '@zodyac/zod-mongoose';
|
|
22
22
|
|
|
23
23
|
const zUser = z.object({
|
|
24
24
|
name: z.string().min(3).max(255),
|
|
@@ -26,6 +26,7 @@ const zUser = z.object({
|
|
|
26
26
|
active: z.boolean().default(false),
|
|
27
27
|
access: z.enum(['admin', 'user']).default('user'),
|
|
28
28
|
companyId: zId.describe('ObjectId:Company'),
|
|
29
|
+
wearable: zUUID.describe('UUID:Wearable'),
|
|
29
30
|
address: z.object({
|
|
30
31
|
street: z.string(),
|
|
31
32
|
city: z.string(),
|
|
@@ -65,10 +66,12 @@ userModel.find({ name: 'John' });
|
|
|
65
66
|
- ✅ ObjectId
|
|
66
67
|
- ✅ ObjectId references
|
|
67
68
|
- ✅ ZodAny as SchemaTypes.Mixed
|
|
69
|
+
- 🔧 UUID (experimental)
|
|
70
|
+
- 🔧 UUID references (experimental)
|
|
68
71
|
- ❗️ Unions (not supported by mongoose)
|
|
69
72
|
- ❗️ Intersection (not supported by mongoose)
|
|
70
73
|
- ❗️ Indexes (not supported by zod)
|
|
71
|
-
-
|
|
74
|
+
- ❗️ Number enums (comming soon)
|
|
72
75
|
- ⏳ Regex validation (comming soon)
|
|
73
76
|
- ⏳ Custom validators (comming soon)
|
|
74
77
|
- ⏳ instanceOf (comming soon)
|