Cov txheej txheem:

Kuv yuav tso tag nrho cov ntawv sau hauv MongoDB li cas?
Kuv yuav tso tag nrho cov ntawv sau hauv MongoDB li cas?

Video: Kuv yuav tso tag nrho cov ntawv sau hauv MongoDB li cas?

Video: Kuv yuav tso tag nrho cov ntawv sau hauv MongoDB li cas?
Video: Supryze - Xaus 2024, Kaum ib hlis
Anonim

1 Teb. db ua. dropDatabase() yuav poob tus database , uas yuav poob tag nrho ntawm kev sau hauv ib database . Yog koj xav pom dab tsi databases koj muaj, koj tuaj yeem ua dbs.

Raws li txoj cai, kuv yuav tso tseg li cas hauv MongoDB?

MongoDB Delete Collection

  1. Xaiv lub database qhov twg koj sau yog, nrog USE hais kom ua. siv
  2. Tshawb xyuas yog tias cov khoom muaj nyob. qhia collections.
  3. Qhov teeb meem drop() hais kom ua ntawm lub sau.
  4. Yog tias Kev Sau tau raug tshem tawm tiav lawm ces 'muaj tseeb' yog echoed rov qab raws li kev lees paub, lwm tus 'false' yuav tau rov qab.

Qhov thib ob, Kuv yuav saib cov khoom sau hauv MongoDB li cas? Siv cov yeeb yam kev sau lus txib los ntawm MongoDB plhaub los sau tag nrho sau tsim nyob rau hauv cov ntaub ntawv tam sim no. Ua ntej, xaiv cov ntaub ntawv koj xav tau saib tus sau . Xaiv mydb database thiab khiav qhia kev sau hais kom sau muaj Cov ntawv sau hauv MongoDB database.

Yog li ntawd, kuv yuav ua li cas tshem tawm tag nrho cov ntaub ntawv los ntawm kev sau hauv MongoDB?

Rau rho tawm tag nrho cov ntaub ntawv hauv a sau , hla ib daim ntawv khoob ({}). xaiv tau. Txhawm rau txwv qhov kev tshem tawm tsuas yog ib daim ntawv, teem rau qhov tseeb. Omit siv tus nqi tsis raug thiab rho tawm tag nrho cov ntaub ntawv txuam nrog cov txheej txheem tshem tawm.

Kuv yuav rho tawm cov collections li cas?

Rho tawm ib phau

  1. Ntawm lub xov tooj Android lossis ntsiav tshuaj, qhib Google+ app.
  2. Hauv qab, coj mus rhaub Sau.
  3. Coj mus rhaub ib phau.
  4. Coj mus rhaub Ntxiv. ?Delete sau.
  5. Kos lub thawv, ces coj mus rhaub Rho tawm.

Pom zoo: