エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
PythonでmongoDBを操作する~その6:aggregate編~ - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
PythonでmongoDBを操作する~その6:aggregate編~ - Qiita
from pymongo import MongoClient class MongoSample(object): def __init__(self, dbName, collectionN... from pymongo import MongoClient class MongoSample(object): def __init__(self, dbName, collectionName): self.client = MongoClient() self.db = self.client[dbName] #DB名を設定 self.collection = self.db.get_collection(collectionName) def aggregate(self, filter, **keyword): return self.collection.aggregate(filter, keyword) from mongo_sample import MongoSample import pprint # arg1:DB Name # arg2:Collection