We help IT Professionals succeed at work.

Powershell and jsons to a Mongodb + PS management mongodb itemd

High Priority
190 Views
Last Modified: 2019-08-14
Hi,

I have a lot of json files which contain data of software: name, vendor, date requested, date packaged, metadata like description, where to download etc.
I add this data automated via Powershell.
I do query the files regularely but this takes to much time (to many files).

I have a MongoDB on a Linux server and would like to move the jsons to this mongodb.

Please advise howto do this via Powershell: add/remove jsons, query mongodb, adjust/asd/remove item in mongodb

J
Comment
Watch Question

Analyst Assistant
CERTIFIED EXPERT
Commented:
There's a module, Mdbc, of MongoDB cmdlets for powershell - here's a link.

Author

Commented:
Thanks. That helps for PS and Mongo indeed. But how do I Mass import the jsons then?
Get-content convertfromjson, then howto import them and read/manipulate the data in a conventient way? Somebody Else must have done it, there must be some scripts ready to use as an example.
NorieAnalyst Assistant
CERTIFIED EXPERT

Commented:
If you search 'mongodb powershell' you'll find plenty of stuff, for example here's a couple of things on GItHub - PSMongo and Import-CsvToMongo.ps1.

PS Does it have to be Powershell?

Author

Commented:
Answered my question, but was expecting more input/an example to get me going with PS and Mongo.
Anyway, will create other ticket for that then.