Home - sgtbelly/class-1 GitHub Wiki
Class 11:
• Why - Two types of Databases SQL and NoSQL
• What - Examples:
1. SQL Database Examples:
1. MySql Community Edition - MySQL database is a very popular open-source database. It is generally been stacked with apache and PHP, although it can be also stacked with nginx and server-side javascript using Node Js. The following are some of MySQL benefits and strengths:
2. MS-SQL Server Express Edition - It is a powerful and user-friendly database which has good stability, reliability, and scalability with support from Microsoft. The following are some of MS-SQL benefits and strengths:
3. Oracle Express Edition - It is a limited edition of Oracle Enterprise Edition server with certain limitations. This database is free for development and deployment. The following are some of Oracle benefits and strengths:
2. NoSQL Database Examples
1. MongoDB - MongoDB is one of the most popular documents based NoSQL database as it stores data in JSON like documents. It is a non-relational database with a dynamic schema. It has been developed by the founders of DoubleClick, written in C++ and is currently being used by some big companies like The New York Times, Craigslist, MTV Networks. The following are some of MongoDB benefits and strengths:
2. CouchDB - CouchDB is also a document based NoSQL database. It stores data in form of JSON documents. The following are some of CouchDB benefits and strengths:
3. Redis - Redis is another Open Source NoSQL database which is mainly used because of its lightning speed. It is written in ANSI C language. The following are some of Redis benefits and strengths:
• How- SQL databases are the best fit for heavy-duty transactional type applications, as it is more stable and promises the atomicity as well as the integrity of the data. While you can use NoSQL for transactions purpose, it is still not comparable and stable enough in high load and for complex transactional applications.
Class 12
1. count - Parameters
• [filter] «Object» count documents that match this object
• [callback] «Function» optional params are (error, count)
Returns: • «Query» this 2. find - Parameters • [filter] «Object» mongodb selector. If not specified, returns all documents. • [callback] «Function» Returns: • «Query» this
3. findOne - Parameters
• [filter] «Object» mongodb selector
• [projection] «Object» optional fields to return
• [options] «Object» see setOptions()
• [callback] «Function» optional params are (error, document)
Returns: • «Query» this 4. findOneAndRemove - Parameters • [conditions] «Object» • [options] «Object» • [options.rawResult] «Boolean» if true, returns the raw result from the MongoDB driver • [options.strict] «Boolean|String» overwrites the schema's strict mode option • [callback] «Function» optional params are (error, document) Returns: • «Query» this 5. findOneAndUpdate - Parameters • [query] «Object|Query» • [doc] «Object» • [options] «Object» • [options.rawResult] «Boolean» if true, returns the raw result from the MongoDB driver • [options.strict] «Boolean|String» overwrites the schema's strict mode option • [options.multipleCastError] «Boolean» by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. • [options.lean] «Object» if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See Query.lean(). • [callback] «Function» optional params are (error, doc), unless rawResult is used, in which case params are (error, writeOpResult) Returns: • «Query» this 6. remove - Parameters • conditions «Object» • [callback] «Function» Returns: • «Query» 7. update - Parameters • [criteria] «Object» • [doc] «Object» the update command • [options] «Object» • [options.multipleCastError] «Boolean» by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. • [callback] «Function» optional, params are (error, writeOpResult) Returns: • «Query» this 8. updateOne - Parameters • [criteria] «Object» • [doc] «Object» the update command • [options] «Object» • [callback] «Function» params are (error, writeOpResult) Returns: • «Query» this 9. updateMany - Parameters • [criteria] «Object» • [doc] «Object» the update command • [options] «Object» • [callback] «Function» optional params are (error, writeOpResult) Returns: • «Query» this