• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > Python使用MONGODB入门实例

Python使用MONGODB入门实例

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了python连接mongodb,python操作mongodb,python mongodb,python3 mongodb,python查询mongodb等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

本文实例讲述了Python使用MONGODB的方法。分享给大家供大家参考。具体如下:

1. 启动mongodb

mongod --dbpath d:\db
</div>

2. 启动为系统应用

mongod --dbpath d:\db --install --logpath d:\db\log.txt
</div>

3. 在系统管理上删除mongodb

sc delete Mongodb
</div>

4. 安装pymongo

easy_install pymongo
</div>

5. 简单的测试

from pymongo import Connection
conn = Connection("localhost")
db = conn.foo
test = {"name":"imouren"}
db.foo.save(test)
cursor = db.foo.find()
for i in cursor:
  print i
</div>

希望本文所述对大家的Python程序设计有所帮助。

</div>

您可能想查找下面的文章:

  • 在 Python 应用中使用 MongoDB的方法
  • 在 Python 应用中使用 MongoDB的方法
  • Python+MongoDB自增键值的简单实现
  • Python中MySQL数据迁移到MongoDB脚本的方法
  • Python中MySQL数据迁移到MongoDB脚本的方法
  • Python保存MongoDB上的文件到本地的方法
  • Python简单连接MongoDB数据库的方法
  • Python简单连接MongoDB数据库的方法
  • python&MongoDB爬取图书馆借阅记录
  • python操作mongodb根据_id查询数据的实现方法

相关文章

  • Python笔记(叁)继续学习
  • Python类定义和类继承详解
  • Python中多线程的创建及基本调用方法
  • Python抓取框架 Scrapy的架构
  • Python中Collection的使用小技巧
  • python实现自动重启本程序的方法
  • Python中不同进制互相转换(二进制、八进制、十进制和十六进制)
  • Python多线程编程(一):threading模块综述
  • Python 变量类型及命名规则介绍
  • python实现应用程序在右键菜单中添加打开方式功能

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Python Web框架Pylons中使用MongoDB的例子
    • 在Django中进行用户注册和邮箱验证的方法
    • Python中的hypot()方法使用简介
    • python原始套接字编程示例分享
    • python开发环境PyScripter中文乱码问题解决方案
    • 使用Python的Tornado框架实现一个Web端图书展示页面
    • 用Python编写web API的教程
    • 详解Python中contextlib上下文管理模块的用法
    • Python判断变量是否已经定义的方法
    • 使用python检测手机QQ在线状态的脚本代码

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有