Same Schema within Schema in Mongoose

var dirSchema = new mongoose.Schema([{type:String, 
                name:String, path:String, children:[dirSchema]}]);

I want to store this type of schema using nodejs in mongodb? It is just like a file system structure. How do i query into the collections if i have a path say /foo/bar/hello/123.