Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2162

MongoError: "$match with $text is only allowed as the first pipeline stage"

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.3.2
    • Component/s: Core

      The code below produces the error "$match with $text is only allowed as the first pipeline stage", even though $match with $text is the only pipeline stage. Is there a subtle syntax error somewhere, or what else might be going on?

      const collectionChangeStream = collection.watch([
        { $match: { $text: { $search: 'cake' } } },
      ]);
      
      collectionChangeStream.on('change', next => {
        console.log(next);
      });
      

            Assignee:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Reporter:
            dandv Dan Dascalescu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: