Advertisement
AmbarG

mongoDB

Nov 12th, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. use Ventas
  2. switched to db Ventas
  3. db.Empresa.insertOne({cuit:2744516180,})
  4. {
  5. acknowledged: true,
  6. insertedId: ObjectId('6733667f31765e9c769672c6')
  7. }
  8. show dbs
  9. Ventas 16.00 KiB
  10. admin 40.00 KiB
  11. config 108.00 KiB
  12. local 72.00 KiB
  13. db.Empresa.find().pretty()
  14. {
  15. _id: ObjectId('6733667f31765e9c769672c6'),
  16. cuit: 2744516180
  17. }
  18. db.Empresa.deleteMany({})
  19. {
  20. acknowledged: true,
  21. deletedCount: 1
  22. }
  23. db.Empresa.insertOne({"cuit": 2744516180, "nombre": "Empresa A", "direccion": "Gorriti 455", "email": "[email protected]"} )
  24. {
  25. acknowledged: true,
  26. insertedId: ObjectId('673368f531765e9c769672c7')
  27. }
  28. db.Empresa.insertOne({"cuit": 27444561233, "nombre": "Empresa B", "direccion": "Forestal 777", "email": "[email protected]"})
  29. {
  30. acknowledged: true,
  31. insertedId: ObjectId('6733698431765e9c769672c8')
  32. }
  33. db.Empresa.insertOne({"cuit": 78563451786, "nombre": "Empresa C", "direccion": "Tello 477", "email": "[email protected]"})
  34. {
  35. acknowledged: true,
  36. insertedId: ObjectId('67336a7d31765e9c769672c9')
  37. }
  38. db.Empresa.insertOne({"cuit": 23486782546, "nombre": "Empresa D", "direccion": "Balcarce 455", "email": "[email protected]"})
  39. {
  40. acknowledged: true,
  41. insertedId: ObjectId('67336ad331765e9c769672ca')
  42. }
  43. db.Empresa.insertOne({"cuit": 45908761235, "nombre":Emprsa E,"direccion": "Guison 566", "email": "[email protected]"})
  44. SyntaxError: Unexpected token, expected "," (1:59)
  45.  
  46. > 1 | db.Empresa.insertOne({"cuit": 45908761235, "nombre":Emprsa E,"direccion": "Guison 566", "email": "[email protected]"})
  47. | ^
  48. db.Empresa.insertOne({"cuit": 45908761235, "nombre":"Emprsa E","direccion": "Guison 566", "email": "[email protected]"})
  49. {
  50. acknowledged: true,
  51. insertedId: ObjectId('67336b6531765e9c769672cb')
  52. }
  53. db.Empresa.find().pretty()
  54. {
  55. _id: ObjectId('673368f531765e9c769672c7'),
  56. cuit: 2744516180,
  57. nombre: 'Empresa A',
  58. direccion: 'Gorriti 455',
  59. }
  60. {
  61. _id: ObjectId('6733698431765e9c769672c8'),
  62. cuit: 27444561233,
  63. nombre: 'Empresa B',
  64. direccion: 'Forestal 777',
  65. }
  66. {
  67. _id: ObjectId('67336a7d31765e9c769672c9'),
  68. cuit: 78563451786,
  69. nombre: 'Empresa C',
  70. direccion: 'Tello 477',
  71. }
  72. {
  73. _id: ObjectId('67336ad331765e9c769672ca'),
  74. cuit: 23486782546,
  75. nombre: 'Empresa D',
  76. direccion: 'Balcarce 455',
  77. }
  78. {
  79. _id: ObjectId('67336b6531765e9c769672cb'),
  80. cuit: 45908761235,
  81. nombre: 'Emprsa E',
  82. direccion: 'Guison 566',
  83. }
  84. db.Repuesto.insertOne({"codigo": 3456,"nombre":"Repuesto A", "descripcion": "Descripcion del repuesto A", "precio": 150})
  85. {
  86. acknowledged: true,
  87. insertedId: ObjectId('67336cc731765e9c769672cc')
  88. }
  89. db.Repuesto.insertOne({"codigo": 0222, "nombre": "Repuesto B", "descripcion": "Descripcion del respuesto B", "precio": 120})
  90. {
  91. acknowledged: true,
  92. insertedId: ObjectId('67336d0031765e9c769672cd')
  93. }
  94. db.Repuesto.insertOne({"codigo": 3444, "nombre": "Repuesto c", "descripcion": "Descripcion del respuesto C", "precio": 345.6})
  95. {
  96. acknowledged: true,
  97. insertedId: ObjectId('67336d2d31765e9c769672ce')
  98. }
  99. db.Repuesto.insertOne({"codigo": 3404, "nombre": "Repuesto D", "descripcion": "Descripcion del respuesto D", "precio": 455.6})
  100. {
  101. acknowledged: true,
  102. insertedId: ObjectId('67336d7031765e9c769672cf')
  103. }
  104. db.Repuesto.insertOne({"codigo": 5545, "nombre": "Repuesto E", "descripcion": "Descripcion del respuesto E", "precio": 1000.9})
  105. {
  106. acknowledged: true,
  107. insertedId: ObjectId('67336dae31765e9c769672d0')
  108. }
  109. db.Repuesto.find().pretty()
  110. {
  111. _id: ObjectId('67336cc731765e9c769672cc'),
  112. codigo: 3456,
  113. nombre: 'Repuesto A',
  114. descripcion: 'Descripcion del repuesto A',
  115. precio: 150
  116. }
  117. {
  118. _id: ObjectId('67336d0031765e9c769672cd'),
  119. codigo: 146,
  120. nombre: 'Repuesto B',
  121. descripcion: 'Descripcion del respuesto B',
  122. precio: 120
  123. }
  124. {
  125. _id: ObjectId('67336d2d31765e9c769672ce'),
  126. codigo: 3444,
  127. nombre: 'Repuesto c',
  128. descripcion: 'Descripcion del respuesto C',
  129. precio: 345.6
  130. }
  131. {
  132. _id: ObjectId('67336d7031765e9c769672cf'),
  133. codigo: 3404,
  134. nombre: 'Repuesto D',
  135. descripcion: 'Descripcion del respuesto D',
  136. precio: 455.6
  137. }
  138. {
  139. _id: ObjectId('67336dae31765e9c769672d0'),
  140. codigo: 5545,
  141. nombre: 'Repuesto E',
  142. descripcion: 'Descripcion del respuesto E',
  143. precio: 1000.9
  144. }
  145. Ventas
  146. Selection deleted
  147.  
  148.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement