用Python操作Mongo時,常忘記一些指令,所以做下筆記,會持續更新。
# vals是1100時
coll.find({"vals":1100})
# or條件
coll.find({"$or":[ {"vals":1700}, {"vals":100}]})
# and條件
coll.find({"$and":[ {"vals":100}, {"vals":1100}]})
# artContent contains keyword
coll.find({"$and":[{"date.year":yearshow},{"date.month":monthShow},{"artContent": re.compile(keyword)}]})
2017年5月22日 星期一
訂閱:
文章 (Atom)
Centos GUI Webserver 設定
新灌的一台Centos7可以做以下的設定 語系設定: - sudo localectl set-locale LC_CTYPE=zh_TW.UTF-8 修改ssh port - http://linux.vbird.org/linux_server/0310telne...
-
現在市面上的智慧家居玲琅满目,上週的課程剛好有學到繼電器,所以就順帶做個智慧插座。這次DIY的智慧插座功能很簡單,純粹只用網頁開關插座,沒有其他功能。(RaspberryPi使用Python編寫,其實蠻容易擴充功能的。) 1. 首先,準備好RaspberryPi,麵包板、繼電...
-
安裝Anaconda 前往官網 https://www.continuum.io/downloads 下載sh bash Anaconda3-4.4.0-MacOSX-x86_64.sh #安裝設定 #新建環境 conda create --name crawlerP...
-
近期在玩 RaspberryPi,需要Lamp功能,邊裝邊紀錄過程,方便下次直接複製XD RaspberryPi + Apache + PHP + MariaDB + Phpmyadmin # 更新套件 sudo apt-get update & sudo apt...