Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Differences between MySQL and MongoDB
- Selecting records from the customer table:
- ```
- MySQL: SELECT * FROM customer
- MongoDB: db.customer.find()
- ```
- Inserting records into the customer table:
- ```
- MySQL: INSERT INTO customer (cust_id, branch, status) VALUES ('appl01', 'main', 'A')
- MongoDB: db.customer.insert({ cust_id: 'appl01', branch: 'main', status: 'A' })
- ```
- Updating records in the customer table:
- ```
- MySQL: UPDATE customer SET branch = 'main' WHERE custage > 2
- MongoDB: db.customer.update( { custage: { $gt: 2 } }, { $set: { branch: 'main' } }, { multi: true } )
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement