Hey. So I have a self referencing multidimensiona...
# orm-help
p
Hey. So I have a self referencing multidimensional table (one -> many)
Copy code
select count(*) from forum_post where id = '01G229XJPH7BTHFD89B7TD45XX' OR "postId" = '01G229XJPH7BTHFD89B7TD45XX';
 count
-------
     2
(1 row)
Copy code
return db.forumPost.count({
      where: {
        OR: [
          {
            id: postId,
            postId: postId,
          },
        ],
      },
    })
Is this a bug, Or maybe I'm using the OR cond wrong? Thanks
j
Copy code
return db.forumPost.count({
      where: {
        OR: [
          {
            id: postId,
          },
          {
            postId: postId,
          },
        ],
      },
    })
🙌 2
try that.
p
That works, thanks so much!
👍🏻 1