윈도우 파이썬에서 pip 사용시 cmd 관리자 권한으로 실행 후 pip 사용


http://ngee.tistory.com/336?category=662804


import pymongo

connection = pymongo.MongoClient("localhost", 27017)

db =connection.local

collection =db.users

rows=collection.find()

print(rows)

row=collection.find_one() //맨처음 것을 보고 싶을때사용

print(row)

collection.insert_one({"id":77,"name":"안녕","password":0})

// 하나를 삽입

results = collection.find()

for result in results:

    print(result)

//컬렉션(테이블) 내의 모든 값들 출력

collection.update_many({'id':'up33' },{"$set":{'id':77,'name':'hi'}},upsert=True)

업데이트 연산자를 지정해줘야 한다. $set <- 업데이트 연산자(?) 뭐지



http://brownbears.tistory.com/282

몽고디비 참고 사이트중에서 설명 가장 잘되어있음


DeprecationWarning: insert is deprecated.

 Use insert_one or insert_many instead.

insert는 더이상 사용되지않습니다.

insert_onde 이나 insert_many를 대신에 사용하세요


DeprecationWarning: update is deprecated.

 Use replace_one, update_one or update_many instead.

insert와 동일


=================5월 16일에 보기===========

https://velopert.com/594

https://velopert.com/436

몽고디비 !!


몽고디비는 컬랙션을 만들때 데이터의 사이즈를 결정해 줄 수 있다.

사이즈 결정시 그 사이즈 이상이 넘으면 가장 오래된 데이터를 삭제한후 삽입된다.

https://www.youtube.com/watch?v=m5k0RGd5rSI&index=33&list=PL9FpF_z-xR_GMujql3S_XGV2SpdfDBkeC


https://docs.mongodb.com/v2.4/reference/method/db.collection.find/

2.4버전에서의 Mongodb 사용방법

+ Recent posts