Some assistance please…
I am able to submit my collection data and after doing a db.dbname.find(), it does reflect the data that I have captured in the database.
However on my meteor toys, mongol interface, I dont see anything.
I have created a subscription on the client side, as such:
Meteor.subscribe('patients');
and also a publish on the server side
Meteor.publish('patients', function(){
return
Patients.find({author: this.userId});
});
Still though, I cant see it on my mongol screen when I click on my collection.
My collection is structured as follows:
Patients = new Mongo.Collection('patients');
Patients.allow({
insert: function(userId, doc) {
return !!userId;
},
update: function(userId, doc) {
return !!userId;
}
});
Complaint = new SimpleSchema({
description: {
type: String
},
severity: {
type: String
}
});
PatientSchema = new SimpleSchema({
FirstName: {
type: String,
label: "First Name"
},
LastName: {
type: String,
label: "Last Name"
},
IdentityNumber: {
type: Number,
label: "Identity Number"
},
Address: {
type: String,
label: "Address"
},
PhoneNumber: {
type: Number,
label: "Phone Number"
},
Complaint: {
type: [Complaint]
},
inHistory: {
type: Boolean,
defaultValue: false,
optional: true,
autoform: {
type: "hidden"
}
},
Author: {
type: String,
label: "Author",
autoValue: function(){
return this.userId;
},
autoform: {
type: "hidden",
label: false,
},
},
createdAt: {
type: Date,
label: "Created At",
autoValue: function() {
return new Date()
},
autoform: {
type: "hidden"
}
}
});
Meteor.methods({
toggleRecordItem: function(id, currentState) {
Patients.update(id, {
$set: {
inRecord: !currentState
}
});
},
deletePatient: function(id) {
Patients.remove(id);
}
});
Patients.attachSchema( PatientSchema );