Dynamic mongodb operation

83 Views Asked by At

I'm trying to get all documents that their health is less than their maxHealth but I don't find any success and I don't find any information online, please assist.

This is the code I used

/**
 * query: The query in MQL.
 */
{
  health: {
    $lt: '$maxHealth'
  }
}

enter image description here

0

There are 0 best solutions below