abc.ts 534 B

123456789101112131415161718192021222324252627
  1. import { InferSchemaType, Schema, SchemaTypes } from "mongoose";
  2. export const schema = new Schema({
  3. name: {
  4. type: SchemaTypes.String,
  5. required: true
  6. },
  7. autofill: {
  8. enabled: {
  9. type: SchemaTypes.Boolean,
  10. required: false
  11. }
  12. },
  13. someNumbers: [{ type: SchemaTypes.Number }],
  14. songs: [
  15. {
  16. _id: { type: SchemaTypes.ObjectId, required: true }
  17. }
  18. ],
  19. restrictedName: {
  20. type: SchemaTypes.String,
  21. restricted: true
  22. },
  23. aNumber: { type: SchemaTypes.Number, required: true }
  24. });
  25. export type AbcSchema = typeof schema;