Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. ## Differences between MySQL and MongoDB
  2. Selecting records from the customer table:
  3. ```
  4. MySQL: SELECT * FROM customer
  5.  
  6. MongoDB: db.customer.find()
  7. ```
  8. Inserting records into the customer table:
  9. ```
  10. MySQL: INSERT INTO customer (cust_id, branch, status) VALUES ('appl01', 'main', 'A')
  11.  
  12. MongoDB: db.customer.insert({ cust_id: 'appl01', branch: 'main', status: 'A' })
  13. ```
  14. Updating records in the customer table:
  15. ```
  16. MySQL: UPDATE customer SET branch = 'main' WHERE custage > 2
  17.  
  18. MongoDB: db.customer.update( { custage: { $gt: 2 } }, { $set: { branch: 'main' } }, { multi: true } )
  19. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement