A repository of MongoDB snippets to update, modify, and fix SciCat metadata in the database. These scripts are designed to help manage data issues, such as correcting run numbers, updating owners, modifying proposals, and handling published data.
- Update run numbers for existing datasets.
- Correct owner information and proposals.
- Modify published data flags.
- Perform targeted updates for improved data consistency.
- MongoDB installed and accessible.
- A MongoDB client (e.g.,
mongosh
orMongoDB Compass
). - Basic familiarity with MongoDB queries.
-
Clone the repository:
git clone https://github.com/your-username/scicat-mongo-snippets.git
cd scicat-mongo-snippets -
Connect to your MongoDB instance:
mongosh mongodb://your-mongodb-uri -
Run the desired snippet by copying and pasting it into the MongoDB shell.
db.datasets.updateMany({ runNumber: { $exists: true } }, { $set: { runNumber: 1001 } });
db.datasets.updateMany({ owner: "oldOwner" }, { $set: { owner: "newOwner" } });
db.datasets.updateMany({ proposalId: "oldProposal" }, { $set: { proposalId: "newProposal" } });
db.datasets.updateMany({ isPublished: false }, { $set: { isPublished: true } });
snippets/
: Directory containing categorized MongoDB snippet files.runNumbers.js
: Scripts for updating run numbers.owners.js
: Scripts for updating owner information.proposals.js
: Scripts for managing proposal data.publishedData.js
: Scripts for managing publication status.
README.md
: Documentation for the repository.
-
Fork the repository.
-
Create a new branch:
git checkout -b feature/your-feature -
Commit your changes:
git commit -m "Add your feature" -
Push the branch:
git push origin feature/your-feature -
Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Easily manage and fix SciCat data with these MongoDB snippets! 🛠️✨