Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 48 typed schema #55

Merged
merged 4 commits into from
Jan 19, 2023

Conversation

saracalihan
Copy link
Member

type and optional default value added to schema usage.

Data types:

  • String
  • Boolean
  • Date
  • Number
  • Array
  • Object:
import { Types } from 'metronom';
const userModel = metronom.define(
// const userModel = new Model(
  {
    name: {
      type: Types.String,
    },
    surname: {
      type: Types.String,
    },
    age: {
      type: Types.Number,
      default: 1
    },
    isAdmin: {
      type: Types.Boolean,
      dafeult: false,
    }
  },
  'users',
  { 
    keyUnique: 'name',
    // set `flexSchema` to true and never define schema
  }
);

@saracalihan saracalihan changed the title Issue 48 new schema Issue 48 typed schema Jan 19, 2023
@saracalihan saracalihan merged commit 6521ef0 into anchovycation:main Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ CRITICAL BUG ] şema içinde varsayılan değer null verildiğinde okuma yapılamıyor.
1 participant