Posted at

pymongoでdistinct

More than 5 years have passed since last update.

colはcollectionオブジェクト

col.distinct(column_name, {'pokopoko':'poko'})

としたらTypeError: distinct() takes exactly 2 arguments (3 given)とおこられる

col.find({'pokopoko':'poko'}).distinct(column_name)

とすればよい