php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #52220 mongodb update not work
Submitted: 2010-07-01 12:41 UTC Modified: 2010-08-15 17:54 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: renziming29 at 163 dot com Assigned: kristina (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 5.2.13 OS: windows 2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: renziming29 at 163 dot com
New email:
PHP Version: OS:

 

 [2010-07-01 12:41 UTC] renziming29 at 163 dot com
Description:
------------
	$m2 = new Mongo("127.0.0.1:27017");
	$db2 = $m2 -> TestData;
	$comname = $db2 -> TestCom;
	$newdata = array('$set' => array("ComName"=>"qwert"));//$cname
	$comname -> update(array('ID' => "1419518423"),$newdata);

not modify 
???
没有修改成功


Test script:
---------------
1.
	$m2 = new Mongo("127.0.0.1:27017");
	$db2 = $m2 -> TestData;
	$comname = $db2 -> TestCom;
	$newdata = array('$set' => array("ComName"=>"qwert"));//$cname
	$comname -> update(array('ID' => "1419518423"),$newdata);

not modify 

2.

$query = array('ID' => $comid);
//##$cursor = $comname -> find($query);//NULL
//@@$cursor = $comname -> find();

the @@ line is work
the ## line is not wok
???





Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-10 03:34 UTC] philip@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: kristina
 [2010-08-10 03:34 UTC] philip@php.net
Kristina, does this make sense to you?
 [2010-08-12 15:55 UTC] kristina@php.net
I think you have a type mismatch, probably.  Is the ID field a string or an integer?  Can you paste a sample document? (var_dump($comname->findOne());)
 [2010-08-15 10:30 UTC] renziming29 at gmail dot com
the id must be int
but i make it the string 
so i wrong.
 [2010-08-15 17:54 UTC] kristina@php.net
-Status: Assigned +Status: Closed
 [2010-08-15 17:54 UTC] kristina@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Cool.  Don't worry, a lot of people do that.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 12:00:01 2026 UTC