- 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.
- Clojure Programming Cookbook
- Web交互界面設計與制作(微課版)
- Visual C#通用范例開發金典
- Visual C++開發入行真功夫
- Visual Basic程序設計
- Python機器學習算法: 原理、實現與案例
- Learning Apache Karaf
- Visual Studio 2015高級編程(第6版)
- GameMaker Essentials
- Xcode 6 Essentials
- Visual Basic程序設計基礎
- Java Web動態網站開發(第2版·微課版)
- 編程的原則:改善代碼質量的101個方法
- Joomla!Search Engine Optimization
- Java EE輕量級解決方案:S2SH