If you have a file called "data.json" of JSON documents, one per line, like this:
{"_id": {"$oid": "5880b85da08bff41ba63449e"}, "a": {"$numberLong": "123"}, "b": 1.0}
{"_id": {"$oid": "5880b85da08bff41ba63449f"}, "a": {"$numberLong": "432"}, "b": 2.0}
... then you can insert it into a collection with a Python program like this:
from bson import json_util
from pymongo import MongoClient
client = MongoClient()
db = client.test
db.collection.remove({}) # Delete existing data.
for line in open('data.json'):
db.collection.insert_one(json_util.loads(line))
This list is for discussion of MongoDB project development/contribution (as well as development of related drivers and tools). In the future, if you have a question about using MongoDB please post the question in the mongodb-user forum.