Project specific object in nth level of nested array

I have a collection of items in mongodb like below:

{
	"_id" : ObjectId("53bd7837156aa38914f55170"),
	"items" [
			{
			"_id": ObjectId("53bd7837156aa38914f55171"),
			"name": "item1",
			"items" [
				{
				"_id": ObjectId("53bd7837156aa38914f55172"),
				"name": "item2",
				"items" [
					{
					"_id": ObjectId("53bd7837156aa38914f55173"),
					"name": "item3",
					"items" [
						{
						"_id": ObjectId("53bd7837156aa38914f55174"),
						"name": "item4",
						}]
					}]
				}]
			},
            {
				"_id": ObjectId("53bd7837156aa38914f55175"),
				"name": "item5",
				"items" [
					{
						"_id": ObjectId("53bd7837156aa38914f55176"),
						"name": "item6",						
					}]
			}
			{
				"_id": ObjectId("53bd7837156aa38914f55175"),
				"name": "item7",
				"items" [
					{
						"_id": ObjectId("53bd7837156aa38914f55176"),
						"name": "item8",						
					}]
			}
			
	]
}

In this collection I have items field that is nested array with infinite depth. If I have _id of item6 , how can I retrieve result like below?

{
  "_id": ObjectId("53bd7837156aa38914f55174"),
  "name": "item6",
}

You cannot have infinite depth. But let’s say the depth is unknown with some theoretical maximum (MongoDB will not accept a document with depth greater than 50, 100 or another limit depending on the server variant and version).

If you have _id of item6 you have to know what level it’s on otherwise you might need to construct a massive query which checks all levels (up to whatever the theoretical limit is).

It’s not totally clear to me though are you asking how to match the document in the collection that has certain _id with name: "item6" or are you asking how to return just a subsection of the document once it’s found some other way?

Asya

Thanks @Asya_Kamsky. Yeah as you said the infinite depth is not a good idea and unknown depth is a better name. To explaining the question, I should say that we have _id of object that its name is item6 so all the things we have is a _id that is ObjectId("53bd7837156aa38914f55176"). I am sorry that asked so bad with mistake typing of _id.
The purpose of query is to getting (project) the item6 when we dont have level and depth of item6. we just want to mapping or unwinding all items to match _id and then project that. Thanks