Implement boolean operations in node.js backend