Comments (5)
I don't think that's a migrate-mongo issue.
The error test.physical-type' already exists
indicates the collection 'physical-type' already exists. Are you sure you have deleted your existing data?
I also don't understand your setup, it looks way too complicated to me.
For example:
- I see that your migration files are in the directory 'scripts/sprint001', while your config indicates they are in the dir 'migrations'.
- Why did you rename & move the generated migration files? It's not something I supported. Plus, the generated 'timestamp' prefix is important: it is used to determine the order of your migrations.
- I have no idea what
npm run deploy
does, because you have not checked in a package.json file in your migrate-mongo-issue git repo.
Please follow the Quickstart section of the README, and use migrate-mongo as intended.
from migrate-mongo.
Hello, I just push the file package.json sorry for that. If you make a pull you will see it clearly, the predeloy.js will just take script in the folders and move them into migrations folder and they will be in alpha order. I really deleted manually the database. If you try it you will probably see what I see. Just exec npm run deploy and delete the test bd and exec npm run deploy again you should see that strange behaviour.
from migrate-mongo.
I currently don't have the time to reproduce your issue, but I'm 100% sure it's not an issue with migrate-mongo: The error is clearly stating that the collection test.physical-type
already exists (when your migration is trying to create that collection).
EDIT: I've just spotted a serious flaw in your migration script:
https://github.com/stherrienaspnet/migrate-mongo-issue/blob/master/scripts/sprint001/script001-add-physical-type.js
=> You did not call next()
callback correctly. You need to call it when all your I/O operations are done.
In your script, you did not provide a callback to the createCollection and insertMany functions (or used their Promise counterpart).
Please read how i/o works in Node.js. I'm afraid I don't have the time to help you with that.
from migrate-mongo.
Thanks :) using async(db, next), await and next to the latest io operation finally resolve it :)
from migrate-mongo.
Great, good luck!
from migrate-mongo.
Related Issues (20)
- Close client rather than use process.exit in cli HOT 1
- SyntaxError: Unexpected token 'export' HOT 3
- Storing Migration results and ability to view them HOT 1
- migrate down Specifies the sequence of js files rollback
- Multi dotted migration file extension
- insertMany is not adding timestamps to the Collection using migration script HOT 1
- Add support for Client side field level encryption
- PR for v6
- Snyk issues for [email protected]
- TypeError: db.runCommand is not a function HOT 5
- ESM mode not compatible with migrationFileExtension in TS HOT 1
- Release 10.0.0 HOT 2
- Support custom config file
- Assigning an `_id` field with a valid mongodb ObjectID value gives a BSON version error HOT 4
- [BUG] Upgrade to v10.0.0 and cannot check migrate mongo version HOT 1
- Issue with -f/--file option: CLI looks for migration directory path in current directory instead of configuration relative
- Typescript & mongoose support HOT 1
- v7 support HOT 1
- ESM configuration module does not work under tsx
- Timestamp is updated for those scripts which are not executed properly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from migrate-mongo.