Example #1
0
                    metavar='Base',
                    dest="selectBase")

groupWarning.add_argument("--all",
                          help="Toute les collections",
                          action="store_true",
                          dest="all")
groupWarning.add_argument("-C",
                          help="selectionne la collection",
                          metavar="COLLECTION",
                          dest="selectCollection")

args = parser.parse_args()

mongo = Mongo(HOST, PORT, USER, PASSWORD)

if (args.base):
    mongo.showDataBase()

if (args.collection):
    mongo.showListCollection(args.selectBase)

if (args.selectCollection and args.selectBase and args.printCollection):
    print(mongo.printCollection(args.selectBase, args.selectCollection))

if (args.selectBase and args.all and args.export):
    mongo.exportAllCollectioni(args.selectBase)

if (args.selectBase and args.selectCollection and args.export):
    mongo.exportOneCollection(args.selectBase, args.selectCollection)