Multiple Schemas in a MongoDB (using Mongoose)

I'm utilizing MongoDB, Mongoose and Node to store user information for a game.

I have a situation where I'm looking to have two set's of records for the game: 1. Users 2. Leader Board

The user info covers things like username, password, number of game-plays and the user's top 5 scores. I currently have a schema set up for this and it works flawlessly.

I've now been asked to add a LeaderBoard which should show the top 10 overall scores for all users. I'd like to set up a separate record for this in the same database to avoid checking all user records and filtering to display the leaderboard. I'd much rather just limit the leaderboard collection to 10 records and each time a user completes a game, check their score against that collection to see if they should be on the leader board. I'm new to mongo/mongoose and not sure how to best approach this.

Any advice would be appreciated.

I'm sure that this is an issue that someone else has run into in the past and if it has been covered here, I apologize, but I've searched and been unable to find something similar.

You don't need another collection to do this. You can do so perfectly with a query in MongoDB.

Suppose I've inserted the following:

db.user.insert({ name: 'foo', scores: [100, 80, 90, 60, 65] });
db.user.insert({ name: 'bar', scores: [95, 120, 83, 70, 42] });
db.user.insert({ name: 'baz', scores: [180, 160, 95, 100, 77] });

Now, to get, let's say, the top 10 games from this collection, you would do the following:

db.user.aggregate([
  { $project: { name: 1, scores: 1 } },
  { $unwind: "$scores" },
  { $sort: { scores: -1, name: 1 } },
  { $limit: 10 }
])

Just to remember, aggregate is a function from Mongo 2.2+. Be sure you have it. For more information about it, check the official documentation.