[SERVER-84591] pymongo does not error on presence of $search against a view created with an empty pipeline Created: 03/Jan/24  Updated: 05/Jan/24

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Seth Payne Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

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

 


Generated at Thu Feb 08 06:55:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.