OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

String Number type date comparison with the number data type in Prisma

  • Thread starter Thread starter Zahid Chandio
  • Start date Start date
Z

Zahid Chandio

Guest
My 'totalGgr' field integer type data stored in the mongoDB is in the string type and I want to compare it with the Integer in Prisma Next.js. How can I do that?

totalGgr field is in string

Below is the part of my query.

Code:
  if (params.totalGgrType === 'Greater than') {
    parentWhereCondition.totalGgr = {
      gt: totalGgrValue
    };
  } else {
    parentWhereCondition.totalGgr = {
      lt: totalGgrValue
    };
  }

I want to compare the number with the string data type in mongoDB using prisma query.

<p>My 'totalGgr' field integer type data stored in the mongoDB is in the string type and I want to compare it with the Integer in Prisma Next.js. How can I do that?</p>
<p><a href="https://i.sstatic.net/3GK3Xa6l.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3GK3Xa6l.png" alt="totalGgr field is in string" /></a></p>
<p>Below is the part of my query.</p>
<pre><code> if (params.totalGgrType === 'Greater than') {
parentWhereCondition.totalGgr = {
gt: totalGgrValue
};
} else {
parentWhereCondition.totalGgr = {
lt: totalGgrValue
};
}
</code></pre>
<p>I want to compare the number with the string data type in mongoDB using prisma query.</p>
 

Latest posts

Online statistics

Members online
0
Guests online
4
Total visitors
4
Top