Comments (1)
You're right. It doesn't really compile in TypeScript. Date.now
returns Number, not the Date.
The mongoose
(and bare JavaScript) though is able to convert Number to Date on the fly. This line of code is quite widespread in codebases which use mongoose
. It is often used for speed, - when you don't want to create the Date complex object but a simple Number.
But if you strongly believe that we still better change it your way, then please submit a PR. I'd be happy to merge it.
Cheers
from medici.
Related Issues (20)
- Mongoose connection string HOT 1
- Missing changelog for 6.0.0 HOT 2
- Value Added Tax HOT 4
- Question: Future Posting Date HOT 5
- start_date and end_date filter on balance API doesn't work correctly if an exisiting balance snapshot is present HOT 1
- Getting Error in Local Dev Server HOT 5
- Intent to ship v7.0 HOT 4
- How to add a Opening Balance to a Book HOT 1
- How to find balance for a previous date ? HOT 1
- Can we know if Debit balance is intentionally given as "negative" value ? HOT 3
- Mongoose Specify Connection HOT 4
- Set Timestamp for Journal Entry HOT 7
- Question: do you have an UI for this or do you plan to build one? HOT 3
- last version not released? HOT 3
- new release HOT 3
- Questions on the implementation HOT 10
- Question: Why MongoDB? Have you considered iterating to a relational db? HOT 1
- How we can update custom field after entry is done HOT 3
- demo or sample
- Failing to get started HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from medici.