github prisma/prisma 2.4.1

latest releases: 5.14.0, 5.13.0, 5.12.1...
3 years ago

Today, we are issuing the 2.4.1 patch release.

When we released the new "Order by multiple fields" feature, you gave us feedback, that the order of properties is not stable in JavaScript. Since ES2015 that is not a problem in the language itself anymore.
However, some teams use the eslint sort-keys plugin, which sorts the keys of objects by alphabet.

Therefore we decided to change the API in a patch release to minimize any problems this might cause to you.

Order by multiple fields in 2.4.0

// order by `age` descending and then by `name` ascending
const users = await prisma.user.findMany({
  orderBy: {
    age: 'desc',
    name: 'asc'
  }
})

Order by multiple fields in 2.4.1

// order by `age` descending and then by `name` ascending
const data = await client.user.findMany({
  orderBy: [
    {
      age: 'desc',
    },
    {
      name: 'asc',
    },
  ],
})

Don't miss a new prisma release

NewReleases is sending notifications on new releases.