I've been playing around with casperjs to login to a site and grab some data that I need. Currently I have a json object that outputs data like this but with much more fields.
{
"Activity #": "1-1IMHEEJM",
"Customer": "DOE, JOHN",
"Tenure": "0 Year 0 Month",
"Account #": "12345678",
"Phone #": "(111) 222-3333",
"Alt Phone #": "",
"Agent Name": "Michelle"
}
and my mongoose schema looks like this.
var workOrderSchema = new mongoose.Schema({
activityNumber: {type: String},
customer: {type: String},
tenure: {type: String},
accountNumber: {type: Number},
phoneNumber: {type: String},
altPhoneNumber: {type: String},
agentName: {type: String}
});
How can I get my data in mongodb using my schema? I can insert the object right into mongo but my fields won't match my schema i.e "Activity #": not activityNumber:
I hope my question is clear and someone can put me in the right direction.
Thanks.