Blog

Xóa Collection trong MongoDB

Phương thức drop() trong MongoDB

Phương thức db.collection.drop() trong MongoDB được sử dụng để xóa một Collection từ cơ sở dữ liệu.

Cú pháp

Cú pháp cơ bản của lệnh drop() là như sau:

db.COLLECTION_NAME.drop()

Ví dụ

Đầu tiên, bạn kiểm tra các Collection có sẵn bên trong cơ sở dữ liệu mydb.

>use mydb switched to db mydb >show collections mycol mycollection system.indexes tutorialspoint >

Bây giờ, bạn xóa Collection với tên mycollection như sau:

>db.mycollection.drop() true >

Sau đó, kiểm tra lần nữa các Collection bên trong cơ sở dữ liệu:

>show collections mycol system.indexes tutorialspoint >

Phương thức drop() sẽ trả về true, nếu Collection đã chọn bị xóa thành công, nếu không, nó sẽ trả về false.

Leave a Reply

Your email address will not be published. Required fields are marked *

suhubet https://jmspc.ac.in/ https://jmslaw.in/ slot4d slotsensa slot gacor https://www.jmsit.ac.in/placement/ suhubet slot4d https://fabritec.pe/asesor.php https://kibf.pk/ slot4d slot gacor https://www.jms.ac.in/admission-procedure/ slot gacor slot luar negeri slot4d slot gacor 4d totogacor slot4d slot gacor slot gacor slot gacor https://promo-sign.com/ slot4d demo slot slot4d https://www.ugelhuaylas.edu.pe/ slot4d slot4d slot4d https://dulsa.com/ slot4d https://fabritec.pe/see/corporacion/ slot4d https://waterco.co.id/pompa-kolam-renang/ https://cliffcrestinn.com/rates/ https://www.bhagwati.ac.in/academics/ https://seteilhas.com.br/site/ https://umgeg.com/ https://www.paracasoverland.com.pe/ slot gacor slot gacor 4d https://amcstoneandcabinets.com/ totogacor slot gacor wd jutaan https://spingharkabul.edu.af/ https://lpmi.handayani.ac.id/surveyB https://www.jalwadancecompany.com/x-2-3-bhangra-dancers/ https://spingharkabul.edu.af/published-papers/ https://littlebigcat.com/ slot4d https://warmihuasi.org/proyectos/ https://coppercoat.com.br/ slot gacor https://www.jetfloweurope.com/ slot gacor https://www.norsal-eg.com/ slot4d https://subhkirancapital.com/ slot gacor https://spingharkabul.edu.af/stomatology/ https://www.balinanny-babbyhire.com/pricing/ https://cliffcrestinn.com/historic-places-to-stay-in-santa-cruz-ca/ https://moalem24.com/ https://pps.handayani.ac.id/ toto 4d https://ekklesiahouses.com/ https://hitchparts.com/ https://praisevibration.com/ https://bolsecol.com/ https://centrobienser.com/ slot gacor https://www.jalwadancecompany.com/ https://solnascentealimentos.com.br/ https://www.balinanny-babbyhire.com/ https://warmihuasi.org/ https://www.blccampus.edu.lk/ https://warmihuasi.org/enlaces/ https://solnascentealimentos.com.br/blog/ https://www.balinanny-babbyhire.com/faq/ https://adibintanpermata.com/shop/ https://www.balinanny-babbyhire.com/contact-us/ https://etasaaceros.com/ https://lpmi.handayani.ac.id/ https://spingharkabul.edu.af/public/hats/ https://spingharkabul.edu.af/hats/ suhubet spaceman slot gacor suhubet https://parokistpaulusdepok.org/ https://kemenagkabsemarang.net/ https://www.realtechnirman.com/contact-us/ https://trattoriabeati.com/about-us/ https://www.realtechnirman.com/project/hijibiji/ https://www.guidanceforever.org/team/ https://www.guidanceforever.org/engineering/maulana-azad-national-institute-of-technology-bhopal/ https://www.guidanceforever.org/medical/ https://www.guidanceforever.org/cources/ https://guidanceforever.org/ https://trattoriabeati.com/ https://autocentermty.com.mx/ https://www.realtechnirman.com/ slot gacor slot gacor slot gacor slot gacor slot gacor slot gacor agentoto situsgacor https://www.realtechnirman.com/blog/ https://autocentermty.com.mx/contacto/ https://trattoriabeati.com/hello-world/ https://kemenagkabsemarang.net/category/islam/ https://autocentermty.com.mx/promociones/ https://autocentermty.com.mx/galeria/ https://www.realtechnirman.com/events/ slot4d totogacor Slot Gacor totogacor situs gacor slot4d SLOT4D slot4d slot gacor 4d Slot Thailand slot4d Slot Thailand Slot Thailand Slot Gacor Maxwin Slot Thailand TOTOGACOR totogacor totogacor slot4d slot dana toto slot slot toto SLOT THAILAND slot thailand toto gacor slot gacor maxwin slot gacor 4d slot gacor server thailand toto4d toto gacor gacorslot