@Override
    public BsonValue visit(Constant constant) {
      Object value = constant.value();
      if (value == null) {
        return BsonNull.VALUE;
      }

      if (value instanceof Iterable) {
        return Filters.in("ignore", (Iterable<?>) value)
                .toBsonDocument(BsonDocument.class, codecRegistry)
                .get("ignore").asDocument()
                .get("$in").asArray();
      }

      return Filters.eq("ignore", value)
              .toBsonDocument(BsonDocument.class, codecRegistry)
              .get("ignore");
    }
Visitor used when special {@code $expr} needs to be generated like {@code field1 == field2}
in mongo it would look like:

<pre>
  {@code
    $expr: {
    $eq: [
      "$field1",
      "$field2"
    ]
  }
  }
</pre>
@see <a href="https://docs.mongodb.com/manual/reference/operator/query/expr/">$expr</a>
criteria/mongo/src/org/immutables/criteria/mongo/FindVisitor.java