Skip to content
Discussion options

You must be logged in to vote

Update

Since v1.0, you can implement your own comparators (in fact, the library no longer ships any built-in comparators at all). This is how you get a gt/lt comparator for strings:

const users = new Collection({
  schema: z.object({
    firstName: z.string(),
    lastName: z.string(),
  }),
})

users.findFirst((q) => q.where({
  firstName: (firstName) => firstName > 'Alice',
  lastName: (lastName) => lastName < 'Doe',
}))

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@ericchernuka
Comment options

@kettanaito
Comment options

@ericchernuka
Comment options

@kettanaito
Comment options

@ericchernuka
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by kettanaito
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants