Skip to content

v0.7.1

Choose a tag to compare

@kettanaito kettanaito released this 05 Nov 11:06
· 125 commits to main since this release

Features

  • Adds in and notIn number comparators (#150).
import { factory, primaryKey } from '@mswjs/data'

const data = factory({
  user: {
    id: primaryKey(String),
    age: Number
  }
})

data.user.findMany({
  where: {
    age: { in: [18, 24, 32] }
  }
})

Note that in/notIn act as Array.prototype.includes and do not represent a permitted range of numbers. Use between/notBetween to query by range.

Bug fixes

  • Fixes an issue when a model with a numeric primary key wasn't queryable via the generated REST API request handlers (#154, #155).