Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6198595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:02:50+00:00 2026-05-24T04:02:50+00:00

{ name: ‘book’, tags: { words: [‘abc’,’123′], lat: 33, long: 22 } } Suppose

  • 0
{ 
    name: 'book',
    tags: {
        words: ['abc','123'],
        lat: 33,
        long: 22
    }
}

Suppose this is a document. How do I remove “words” completely from all the documents in this collection? I want all documents to be without “words“:

 { 
     name: 'book',
     tags: {
         lat: 33,
         long: 22
     }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:02:51+00:00Added an answer on May 24, 2026 at 4:02 am

    Try this: If your collection was ‘example’

    db.example.update({}, {$unset: {words:1}}, false, true);
    

    Refer this:

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24unset

    UPDATE:

    The above link no longer covers ‘$unset’ing. Be sure to add {multi: true} if you want to remove this field from all of the documents in the collection; otherwise, it will only remove it from the first document it finds that matches. See this for updated documentation:

    https://docs.mongodb.com/manual/reference/operator/update/unset/

    Example:

    db.example.update({}, {$unset: {words:1}} , {multi: true});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

id name status 1 abc 1 2 pqr 0 conditional update for same column
Table name: Employee Column Name: Emp_name Emp_name has this contents: xx\rama, xx\rajesh, xx\vignesh I
select name, lat, lng from locations limit 10 What if I want a specific
my name is aderson and in this moment i have something question about composition
My name is Juan I'm from Spain and this is my first post. Thank
table name:id col1:owner-name col2:book-id1 col3:book-id2 table name:book-name col1:id col2:name Can anyone get me a
Suppose name contains non-ascii characters, when I use <s:property value=name /> , Struts automatically
[{name:Mark,Surname:Gaux}] [{Job:2,Type:Office}] I have this JSON echoed by a PHP file on the server
module name: module references __file__ This appears several times when I install my own
Name of the option tells something but what Visual Studio/compiler really do and what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.