Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
MongoDB ReferenceError: Collection is not defined :

Why does MongoDB not allow me to copy one collection into another?

> db.crashntsb.copyTo(crashntsbclean)
2017-01-13T09:09:49.236+0530 E QUERY    [main] ReferenceError: crashntsbclean        
is not defined :

@(shell):1:1
>

It says the new collection is not defined What could be the reason? Do I need to create the collection? In the documentation it says Mongodb creates this new collection https://docs.mongodb.com/v3.2/reference/method/db.collection.copyTo/

Any help greatly appreciated

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

the following code will work for you.

db.crashntsb.copyTo("crashntsbclean")

The double quotes is required although the documentation does not say so.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!