windows 7
1) httpd-2.2.22-win32-x86-openssl-0.9.8t
2) mongo php 5.3 vc6 TS
3) php-5.2.17-Win32-VC6-x86
4) mongo driver dll – mongo-1.1.4-php5.2vc6ts
MONGODB Win7 installation
apache download :
1) httpd-2.2.22-win32-x86-openssl-0.9.8t
2) php-5.2.17-Win32-VC6-x86
http://www.php.net/manual/en/install.windows.apache2.php – u just need below nothing else.. CGI is not safe. and u need a Thread safe binary .. note the VC6 – u need this particular one..
LoadModule php5_module “c:/php/php5apache2.dll”
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir “C:/php”
3) just save the file it gives..its mongo db win 32 (x86) version – dont bother that yours is win8 or win7 – it works http://www.mongodb.org/dr/downloads.mongodb.org/win32/mongodb-win32-i386-2.0.5.zip/download
follow this http://www.mongodb.org/display/DOCS/Quickstart+Windows
4) mongo php driver dll – mongo-1.1.4-php5.2vc6ts (attached the dll already in this email) (see windows section – http://www.mongodb.org/display/DOCS/PHP+Language+Center )
php should be x86 though win7/8 is used
phpinfo() should show mongo installation too
###############################################
Start Mongod.exe
C:\Workspace\mongodb-win32-i386-2.0.5\bin>mongod.exe –journal –dbpath=c:\data
Start mongo.exe (client)
C:\Workspace\>cd mongodb-win32-i386-2.0.5\bin
C:\Workspace\mongodb-win32-i386-2.0.5\bin>mongo.exe
MongoDB shell version: 2.0.5
connecting to: test
> 3+3
6
> db.foo.insert({a:1})
> db.foo.find()
{ “_id” : ObjectId(“4fc9b8de89f72ecdfcb9a3bd”), “a” : 1 }
>
>
> showdbs
Fri Jun 01 23:56:02 ReferenceError: showdbs is not defined (shell):1
> show dbs
local (empty)
test 0.03125GB
>
> show collection
Fri Jun 01 23:56:13 uncaught exception: don’t know how to show [collection]
> show collections
foo
system.indexes
>
>
> db.items.insert({ name: ‘eggs’, quantity: 10, price: 1.50 })
> show collections
foo
items
system.indexes
>
>
> db.items.find()
{ “_id” : ObjectId(“4fc9bbb589f72ecdfcb9a3be”), “name” : “eggs”, “quantity” : 10
, “price” : 1.5 }
>
> db.items.insert({ id:1, name: ‘bacon’, quantity: 3, price: 3.50 })
> db.items.insert({ id:2, name: ‘tomatoes’, quantity: 30, price: 0.50 })
>
> db.items.find()
{ “_id” : ObjectId(“4fc9bbb589f72ecdfcb9a3be”), “name” : “eggs”, “quantity” : 10
, “price” : 1.5 }
{ “_id” : ObjectId(“4fc9bbcf89f72ecdfcb9a3bf”), “name” : “bacon”, “quantity” : 3
, “price” : 3.5 }
{ “_id” : ObjectId(“4fc9bbd789f72ecdfcb9a3c0”), “name” : “tomatoes”, “quantity”
: 30, “price” : 0.5 }
>
>
> db.User.drop()
true
db.users.find({last_name: ‘Smith’}, {‘ssn’: 1});
##########################
Document.where(somecriteriahere: “criteriavaluehere”).update_all(
updated_at: Time.now.to_s)
##############################
original_id = ObjectId()
db.places.insert({
“_id”: original_id,
“name”: “Broadway Center”,
“url”: “bc.example.net”
})
db.people.insert({
“name”: “Erin”,
“places_id”: original_id,
“url”: “bc.exmaple.net/Erin”,
})
#############################