-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set a updateAt time ? #56
Comments
There was no way to pass additional config to the collections automatically created by Neko, I'm putting some in now. The API will be ko.Model('Timestamped', {
schema: ko.String,
etc: ko.String,
}, {
// new third parameter is collection config
// here you can pass all the options available in the nedb API, for instance
timestampData: true
}) |
Ok as of nekodb version 2.4.0 you should be able to pass in timestampData option to NeDB. Let me know how it goes |
const DicomInfo = ko.Model('DicomInfo', {
PatientID: ko.String.default(''),
PatientName: ko.Document({ Alphabetic: ko.String.default('') }),
PatientSex: ko.String.default(''),
PatientAge: ko.String.default(''),
Modality: ko.String.default(''),
BodyPartExamined: ko.String.default(''),
AccessionNumber: ko.String.default(''),
TransferSyntaxUID: ko.String.default(''),
StudyInstanceUID: ko.String.default(''),
SeriesInstanceUID: ko.String.default(''),
SeriesNumber: ko.Option([ko.String,ko.Number]),
SeriesDescription: ko.String.default(''),
SOPInstanceUID: ko.String.default(''),
InstanceNumber: ko.Option([ko.String,ko.Number]),
StudyDate: ko.String.default(''),
StudyTime: ko.String.default(''),
StudyDatetime: ko.String.default(''),
filePath: ko.String.default('')
}, {
// new third parameter is collection config
// here you can pass all the options available in the nedb API, for instance
timestampData: true
}); [2019-10-08 09:25:26.510] [DEBUG] [dimse\index.js:95] [default] - saved doc: Instance { Not effective... |
Is there a way to got a saved object instead of model. |
Ok I doubted myself, but they are in fact being saved to the database they're just not accessible via the model. All you have to do is add
to the model and you will have the timestamps. |
You can do |
Thank you! That's ok for me. |
Nedb's timestampData option can auto set updateAt and createdAt.
How nekodb to set this.
The text was updated successfully, but these errors were encountered: