Skip to content

Commit

Permalink
Include suggestion and fix restore command
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcampbell committed Jan 13, 2025
1 parent 6ae48cc commit 562a1da
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ This is the repository for the NSLS-II Facility API codebase.
## Developer Notes

In order to develop locally you will need to have a local MongoDB running.
This can be installed using your preferred method, a native install or running a container work perfectly fine.
This can be installed using your preferred method, a native install or [running a container](https://hub.docker.com/_/mongo) work perfectly fine.

Once you have MongoDB up and running you then need to 'seed' the facility and beamline information that
does not get pulled from any other source. The json files for the collections can be found at `/nsls2/software/dssi/nsls2core`
does not get pulled from any other source.

1. Copy the `beamlines.json` and `facilities.json` to your development machine
The files for the collections can be found within the `/nsls2/software/dssi/nsls2core/nsls2core-development.tgz`

2. Import facility information into the local mongodb
`mongoimport --db=nsls2core-development --collection=facilities --file=nsls2core.facilities.json`
1. Copy and unpack the archive into a directory (e.g. `nsls2core-development`) to your development machine

2. Import facility information into the local mongodb```
```bash
mongorestore --uri="mongodb://localhost:27017" --nsFrom=nsls2core-development.facilities --nsTo=nsls2core-development.facilities ./nsls2core-development/facilities.bson
```
3. Import beamline information into the local mongodb
`mongoimport --db=nsls2core-development --collection=beamlines --file=nsls2core.beamlines.json`
```bash
mongorestore --uri="mongodb://localhost:27017" --nsFrom=nsls2core-development.beamlines --nsTo=nsls2core-development.beamlines ./nsls2core-development/beamlines.bson
```

You will then need to create a `.env` file that contains the configuration (an example can also be found in the same
directory as the json files).
Expand Down

0 comments on commit 562a1da

Please sign in to comment.