- Build Applications with Meteor
- Dobrin Ganev
- 203字
- 2021-07-09 19:48:55
Explore MongoDB in the Meteor shell
You can access all the application data with the Meteor MongoDB shell.
Open another terminal, cd to the app directory, and start the MongoDB shell.
>> meteor mongo
Show all the databases in MongoDB:
>> show dbs
The default database for the app is named meteor; switch to the meteor database:
>> use meteor
Display all collections in the database:
>>show collections
The show collections command will not return any results.
The reason is that we created a collection on the client side only. This collection exists in Minimongo, and it is in the browser's memory. If we refresh the page, the collection and the data will be gone.
In order to create the same collection and persist data into MongoDB, we have to execute the exact same Time = new Mongo.Collection('time'); on the server. As soon as we do that, both the collections will be in sync and the data will be persisted into the database.
For now, we don't want to save the timer data on the server; we only want to take advantage of the Meteor server to client real-time communication.
- Mastering RabbitMQ
- ASP.NET Core 5.0開發(fā)入門與實戰(zhàn)
- Practical Internet of Things Security
- CentOS 7 Linux Server Cookbook(Second Edition)
- 大學計算機基礎(第2版)(微課版)
- 你不知道的JavaScript(中卷)
- C語言實驗指導及習題解析
- Learning Hunk
- Building RESTful Python Web Services
- Asynchronous Android Programming(Second Edition)
- 0 bug:C/C++商用工程之道
- Visualforce Developer’s guide
- Illustrator CC平面設計實戰(zhàn)從入門到精通(視頻自學全彩版)
- Getting Started with Polymer
- Training Systems Using Python Statistical Modeling