Doc #52220 [Com]: mongodb update not work

From: Date: Sun, 15 Aug 2010 08:30:22 +0000
Subject: Doc #52220 [Com]: mongodb update not work
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4864@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52220&edit=1 ID: 52220 Comment by: renziming29 at gmail dot com Reported by: renziming29 at 163 dot com Summary: mongodb update not work Status: Assigned Type: Documentation Problem Package: Unknown/Other Function Operating System: windows 2003 PHP Version: 5.2.13 Assigned To: kristina Block user comment: N New Comment: the id must be int but i make it the string so i wrong. Previous Comments: ------------------------------------------------------------------------ [2010-08-12 15:55:44] 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-10 03:34:19] philip@php.net Kristina, does this make sense to you? ------------------------------------------------------------------------ [2010-07-01 12:41:09] 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 ??? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52220&edit=1

« previous php.doc.bugs (#4864) next »