Ask Your Question

Revision history [back]

  1. Large Graphs: $graphLookup can cause performance issues when querying on large graphs as it needs to traverse each node to find the paths that match the specified conditions. The more nodes in the graph, the slower the query.

  2. Indexes: $graphLookup cannot use indexes while performing the graph traversal. This means that if the collection being searched has a large number of documents, you may experience significant performance degradation.

  3. Unnecessary Computations: Since $graphLookup performs an entire graph traversal, it may compute and return unnecessary data that does not exist in your search criteria. This results in extra processing time and reduces query performance.

  4. Nested Fields: $graphLookup doesn't work well with nested or embedded fields as it requires paths to be defined using the dot notation. This makes querying documents with complex hierarchies slow and inefficient.

  5. Memory Usage: $graphLookup requires a large amount of memory to perform graph traversals. If the available memory is insufficient, the query performance will suffer.