Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只想知道如何在 mongodb 中输入日期时间。
喜欢: db.collection.insert({username : "name", password : "somepass", createdat: datetimehere})
从贝壳
db.collection_name.insert({username : "name", password : "somepass", createdate: new Date() })
Mongo shell 完全支持 Javascript,因此您可以使用任何与 Javascript 相关的方法。