Mongoose is saying I have 46 records, mongoDB says I have zero?

Problem

The following test script says I have 46 records:

var mongoose = require('mongoose'),
Schema = mongoose.Schema;

var DealSchema = new Schema({
title : String,
});

var Deal = mongoose.model('Deal', DealSchema);

mongoose.connect('mongodb://localhost/dealsite');
mongoose.connection.on("open", function(){
console.log("Mongoose connected");
Deal.count({}, function( err, count){
console.log( "Records:", count );
})
});

output:

$ node testmongo.js 
Mongoose connected
Records: 46

While if I try to read the cords using the mongo shell I get a different story:

$ mongo localhost/dealsite
MongoDB shell version: 1.4.4
url: localhost/dealsite
connecting to: localhost/dealsite
type "exit" to exit
type "help" for help
> db.dealsite.count()
0
> db.dealsite.Deal.count()
0

Where are my records hiding?

Problem courtesy of: Kit Sunde

Solution

In MongoDB, try:

use dealsite
db.deals.count()

If you create a Mongoose model called “Deal”, it will create and use a MongoDB collection called “deals”.

Solution courtesy of: Mike Scott

View additional discussion.