Sponsored Content
Full Discussion: Change value for POSIX
Top Forums UNIX for Advanced & Expert Users Change value for POSIX Post 303002703 by Abhayman on Thursday 31st of August 2017 02:14:54 AM
Old 08-31-2017
Hi, The reason why I am posting it under POSIX smallest allowable upper limit on argument length (all systems): 4096 is because , I am trying to run a mongo query from shell. When I run the query directly on Mongo it works fine but when I run it from shell script it is taking max of 4096 characters only in argument list . So, I am forced to sent it in batches of 175 . I checked with Mongo team and they confirmed it is POSIX limitations of shell which is causing it and nothing to do with Mongo
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Posix and linux

What is posix? What is the relation between Posix, Unix and linux? (1 Reply)
Discussion started by: darbarilal
1 Replies

2. Programming

ANSI C vs POSIX

can somebody explain about the ANSI C vs POSIX. say i was using open and fopen, i know that open is POSIX, and fopen is ANSI C. i read that that POSIX is a system call and ANSI C is like a standard library function. wouldn't the fopen function has to call on open function anyway to open any kind... (2 Replies)
Discussion started by: bb00y
2 Replies

3. Programming

Unix(posix)

Please,does anybody can give me any general info about unix(posix) ? (1 Reply)
Discussion started by: Haris Astreos
1 Replies

4. UNIX for Dummies Questions & Answers

how to read POSIX?

how to read POSIX? poe six or not? (3 Replies)
Discussion started by: robin.zhu
3 Replies

5. Programming

POSIX threads

Hello ! Let's supose I have a main function in C , and two POSIX threads. I give you an example down : int main() { int something; char else; void *FirstThread(); void *SecondThread(); .. <start those two pthreads ..> return 0;} void *FirstThread() { ... } void *SecondThread()... (2 Replies)
Discussion started by: !_30
2 Replies

6. Programming

Posix

HI, When i am configuring php in SUN Solaris. I am getting the below error. configure: error: Your system seems to lack POSIX threads. Do i need to install POSIX? If so can somebody let me know where can i download POSIX for Solaris 8? Thanks, (2 Replies)
Discussion started by: Krrishv
2 Replies

7. UNIX for Advanced & Expert Users

Posix threads

Hi, consider the code below: #include <stdio.h> . . struct myStruct { char *message ; int id; }; . . . void *thread_function( void *ptr ); nt main() { pthread_t thread1, thread2 ,thread3 ; struct myStruct nico1; (2 Replies)
Discussion started by: Behnaz
2 Replies

8. UNIX for Advanced & Expert Users

System V or POSIX

Hi , I am using UNIX network programming Vol1 (by R Stevens) book to learn about IPC. I would be using HP-UX,Solaris and Linux at my work. I have sections for POSIX and for System V in that book. I am quite confused in indentifying those OSs as POSIX or SYstem V. Can anyone please... (1 Reply)
Discussion started by: kumaran_5555
1 Replies

9. Programming

POSIX Thread Help

I want to create a program that creates 2 child process, and each of them creates 2 threads, and each thread prints its thread id. I0ve allread done that the outuput isn't the outuput i want. When a run the following comand "$./a.out | sort -u | wc -l" I have the folowing output 2 $: It should... (3 Replies)
Discussion started by: pharaoh
3 Replies

10. OS X (Apple)

POSIX compliance...

Thanks to all you guys about posix compliance I have learnt an enormous amount over the last few days. I have written a program that is an Egg Timer with simple animation. I now realise how sophisticated 'bash' is compared to full posix compliance. The code below has passed all of the tests from... (11 Replies)
Discussion started by: wisecracker
11 Replies
MONGOCOLLECTION.FINDANDMODIFY(3)					 1					  MONGOCOLLECTION.FINDANDMODIFY(3)

MongoCollection::findAndModify - Update a document and return it

SYNOPSIS
public array MongoCollection::findAndModify (array $query, [array $update], [array $fields], [array $options]) DESCRIPTION
The findAndModify command atomically modifies and returns a single document. By default, the returned document does not include the modi- fications made on the update. To return the document with the modifications made on the update, use the $new option. PARAMETERS
o $query - The query criteria to search for. o $update - The update criteria. o $fields - Optionally only return these fields. o $options - An array of options to apply, such as remove the match document from the DB and return it. +----------------+---------------------------------------------------+ | Option | | | | | | | Description | | | | +----------------+---------------------------------------------------+ | $sort array | | | | | | | Determines which document the operation will | | | modify if the query selects multiple documents. | | | findAndModify will modify the first document in | | | the sort order specified by this argument. | | | | |$remove boolean | | | | | | | Optional if $update field exists. When TRUE, | | | removes the selected document. The default is | | | FALSE. | | | | | $update array | | | | | | | Optional if $remove field exists. Performs an | | | update of the selected document. | | | | | $new boolean | | | | | | | Optional. When TRUE, returns the modified docu- | | | ment rather than the original. The findAndModify | | | method ignores the $new option for remove opera- | | | tions. The default is FALSE. | | | | |$upsert boolean | | | | | | | Optional. Used in conjunction with the $update | | | field. When TRUE, the findAndModify command cre- | | | ates a new document if the query returns no docu- | | | ments. The default is false. In MongoDB 2.2, the | | | findAndModify command returns NULL when upsert is | | | TRUE. | | | | | | | | | | | | | | | | +----------------+---------------------------------------------------+ RETURN VALUES
Returns the original document, or the modified document when $new is set. ERRORS
/EXCEPTIONS Throws MongoResultException on failure. EXAMPLES
Example #1 MongoCollection::findAndModify example <?php $m = new Mongo; $col = $m->selectDB("test")->jobs; $col->insert(array( "name" => "Next promo", "inprogress" => false, "priority" => 0, "tasks" => array( "select product", "add inventory", "do placement"), ) ); $col->insert(array( "name" => "Biz report", "inprogress" => false, "priority" => 1, "tasks" => array( "run sales report", "email report" ) ) ); $col->insert(array( "name" => "Biz report", "inprogress" => false, "priority" => 2, "tasks" => array( "run marketing report", "email report" ) ), array("w" => 1) ); $retval = $col->findAndModify( array("inprogress" => false, "name" => "Biz report"), array('$set' => array('inprogress' => true, "started" => new MongoDate())), null, array( "sort" => array("priority" => -1), "new" => true, ) ); var_dump($retval); ?> The above example will output something similar to: array(6) { ["_id"]=> object(MongoId)#7(1) { ["$id"]=> string(24) "5091b5b244415e8cc3000002" } ["inprogress"]=> bool(true) ["name"]=> string(10) "Biz report" ["priority"]=> int(2) ["started"]=> object(MongoDate)#8(2) { ["sec"]=> int(1351726514) ["usec"]=> int(925000) } ["tasks"]=> array(2) { [0]=> string(20) "run marketing report" [1]=> string(12) "email report" } } Example #2 MongoCollection::findAndModify error handling <?php $m = new Mongo; $col = $m->selectDB("test")->jobs; try { $retval = $col->findAndModify( array("inprogress" => false, "name" => "Next promo"), array('$pop' => array("tasks" => -1)), array("tasks" => array('$pop' => array("stuff"))), array("new" => true) ); } catch(MongoResultException $e) { echo $e->getCode(), " : ", $e->getMessage(), " "; var_dump($e->getDocument()); } ?> The above example will output something similar to: 13097 : exception: Unsupported projection option: $pop array(3) { ["errmsg"]=> string(46) "exception: Unsupported projection option: $pop" ["code"]=> int(13097) ["ok"]=> float(0) } SEE ALSO The MongoDB findAndModify command docs. PHP Documentation Group MONGOCOLLECTION.FINDANDMODIFY(3)
All times are GMT -4. The time now is 07:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy