Skip to content

Projection positional operator $ should not return error for no match #3053

Open
@chilagrow

Description

What should be done?

Target returns error when compat does not. See issue link added by PR #3052

=== RUN   TestQueryProjectionPositionalOperatorCompat/PartialProjection/TestQueryProjectionPositionalOperatorCompat_ArrayAndDocuments
    query_projection_compat_test.go:347: Target error: (Location51246) Executor error during find command :: caused by :: positional operator '.$' couldn't find a matching element in the array
    query_projection_compat_test.go:347: Compat error: <nil>
    query_projection_compat_test.go:347: 
        	Error Trace:	/home/chi/go/src/github.com/chilagrow/FerretDB/integration/helpers.go:199
        	            				/home/chi/go/src/github.com/chilagrow/FerretDB/integration/query_compat_test.go:148
        	Error:      	Should be true
        	Test:       	TestQueryProjectionPositionalOperatorCompat/PartialProjection/TestQueryProjectionPositionalOperatorCompat_ArrayAndDocuments
        	Messages:   	expected is <nil>, not mongo.CommandError
        --- FAIL: TestQueryProjectionPositionalOperatorCompat/PartialProjection/TestQueryProjectionPositionalOperatorCompat_ArrayAndDocuments (0.08s)

Where?

https://github.com/FerretDB/FerretDB/blob/main/integration/query_projection_compat_test.go

https://github.com/FerretDB/FerretDB/blob/main/internal/handlers/common/projection.go

Definition of Done

  • all handlers updated;
  • integration/compatibility tests added/updated;
  • spot refactorings done;

Metadata

Assignees

Labels

code/bugSome user-visible feature works incorrectlynot readyIssues that are not ready to be worked on; PRs that should skip CI

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions