Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-84591

pymongo does not error on presence of $search against a view created with an empty pipeline

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Detailed steps to reproduce the problem?

      Use an Atlas DB/Cluster with a search index

      Query with $search as first stage in pipeline against a view

      -- pymongo correctly provides and error
      pymongo.errors.OperationFailure: $_internalSearchMongotRemote is only valid as the first stage in a pipeline,
      Query with $search as a first stage in pipeline against a view that has been defined without a pipeline.

      -- pymongo does not provide an error.  i believe an empty cursor is returned

      Definition of done: what must be done to consider the task complete?

      pymongo should return an error similar to what it does for using $search against views without pipeline definitions as it does against views with a pipeline definion.

      The exact Python version used, with patch level:

      3.9.6 (default, Nov 10 2023, 13:38:27) 
      [Clang 15.0.0 (clang-1500.1.0.2.5)]

      The exact version of PyMongo used, with patch level:

      4.6.1
      True

      Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.

      Atlas cluster, no sharding.  Using search.

      The operating system and version (e.g. Windows 7, OSX 10.8, ...)

      Mac OS 14.1.2 (23B92)

      Web framework or asynchronous network library used, if any, with version (e.g. Django 1.7, mod_wsgi 4.3.0, gevent 1.0.1, Tornado 4.0.2, ...)

      None

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            seth.payne@mongodb.com Seth Payne
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: