GraphLookup class

$graphLookup

Stage description

Performs a recursive search on a collection, with options for restricting the search by recursion depth and query filter. see mongo db documentation

Dart code:

  GraphLookup(
          from: "follows",
          startWith: "user_id",
          connectFromField: "my_follows",
          connectToField: "followed",
          as: "same_follows",
          depthField: "depth",
          maxDepth: 3,
          restrictSearchWithMatch: where.ne("user_id", "user1"));

Equivalent mongoDB aggregation stage:

  $graphLookup: {
        from: "follows",
        startWith: "$user_id",
        connectFromField: "my_follows",
        connectToField: "followed",
        as: "same_follows",
        depthField: "depth",
        maxDepth : 3,
        restrictSearchWithMatch: {
           follower: {$ne: "user1"}
        }
     }
Inheritance

Constructors

GraphLookup({required String from, required String startWith, required String connectFromField, required String connectToField, required String as, int? maxDepth, String? depthField, dynamic restrictSearchWithMatch})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build() Map<String, Object>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited