How much sophistication can be built into a Mongoose model (query other models, query subdocuments, etc?)

I have a mongoDB that tracks order information, and am using Mongoose to access it. I've used some fairly rudimentary methods in other mongoose schema (to generate user passwords for example), but am wondering if I can do things like:

a) Query other models. Let's say I have a schema for Users and a schema for Orders. I put the ObjectId of the user that placed the order in Orders. Could I have a method like Orders.getCustomerName that can pull the instance's Orders.customerId and then go query the Users collection to get the user name?

b) Query subdocuments. Again using the Orders example, let's assume my Orders collection has an OrderLines array of subdocuments, each with a price. Can I build a method into my model that will iterate through all the Orders.orderLines and return a total price for example?

I've looked through the docs and can't find anything like this, and have Googled to no avail, but might be missing a keyword or concept here.