[SERVER-36598] aggregate $out fails when the _id is projected out with 4.1-latest Created: 10/Aug/18  Updated: 30/Aug/18  Resolved: 13/Aug/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Shane Harvey Assignee: Kyle Suarez
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-36100 Allow missing "_id" from extracted un... Closed
Problem/Incident
causes PYTHON-1624 Test Failure - test_collection.TestCo... Closed
is caused by SERVER-35896 Support "replaceDocuments" mode in $out Closed
Operating System: ALL
Participants:

 Description   

aggregate fails when the _id is projected out with 4.1.1-293-g3927b18

PRIMARY> db.test.insertOne({foo:1})
{
	"acknowledged" : true,
	"insertedId" : ObjectId("5b6e094002374d6d7383f3e2")
}
PRIMARY> db.test.aggregate([{"$project": {"_id": false, "foo": true}}])
{ "foo" : 1 }
PRIMARY> db.test.aggregate([{"$project": {"_id": false, "foo": true}}, {'$out': 'output-collection'}])
assert: command failed: {
	"operationTime" : Timestamp(1533937989, 2),
	"ok" : 0,
	"errmsg" : "Failed to extract unique key from input document: { foo: 1.0 }",
	"code" : 50905,
	"codeName" : "Location50905",
	"$clusterTime" : {
		"clusterTime" : Timestamp(1533937989, 2),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	}
} : aggregate failed

Tested on:

$ ~/Downloads/mongodb-macos-x86_64-enterprise-4.1.1-293-g3927b18/bin/mongod --version
db version v4.1.1-293-g3927b18
git version: 3927b187d07cd5e9c9ebba26ecf9500b261f57fc
allocator: system
modules: enterprise
build environment:
    distarch: x86_64
    target_arch: x86_64



 Comments   
Comment by Kyle Suarez [ 30/Aug/18 ]

As a heads up, SERVER-36100 is resolved.

Comment by Kyle Suarez [ 13/Aug/18 ]

We're building out the new $out incrementally, and there's more work to be done with regard to extracting the uniqueKey. I'm closing this as a duplicate of SERVER-36100.

Comment by Ramon Fernandez Marina [ 10/Aug/18 ]

4.1.1 works, but HEAD does reproduce this issue.

Generated at Thu Feb 08 04:43:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.