In [1]:
from pymongo import MongoClient


client = MongoClient(
    "mongodb.fastcamp.us",
)

In [2]:
db = client["dobestan"]

In [3]:
collection = db["zigbang"]

In [4]:
collection.remove()
collection = db["zigbang"]


/Users/dobestan/.pyenv/versions/datascience/lib/python3.5/site-packages/ipykernel/__main__.py:1: DeprecationWarning: remove is deprecated. Use delete_one or delete_many instead.
  if __name__ == '__main__':

In [5]:
data = {
    'deposit': 1000,
    'rent': 50,
    'address': "서울특별시 관악구 남부순환로 1799 대영오피스텔",
}

collection.insert_one(data)


Out[5]:
<pymongo.results.InsertOneResult at 0x10ee7a870>

In [6]:
collection.find_one()


Out[6]:
{'_id': ObjectId('56cf14525d2bc66f64a5a86a'),
 'address': '서울특별시 관악구 남부순환로 1799 대영오피스텔',
 'deposit': 1000,
 'rent': 50}