10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Some question about the usage of shell scripts:
1.) Are the commands of the base shell scripts a subset of bash commands?
2.) Assume I got a long, long script WITHOUT the first line.
How can I find out if the script was originally designed für "sh" or "bash"?
3.) How can I check a given... (3 Replies)
Discussion started by: pstein
3 Replies
2. AIX
Hi,
I am planning to install a version of Informatica on my AIX box. It requires a specific java build in pap6470_27sr2-20141101_01(SR2).
The current link for IBM 64-bit SDK for AIX®, JavaTM Technology Edition, Version 7 Release 1 has a more recent version in j7r164redist.7.1.0.75.bin.
Is... (4 Replies)
Discussion started by: meetpraveens
4 Replies
3. Solaris
Hi Experts,
I found that the same commands(sort, du, df, find, grep etc.) exists in both dir.
What is the difference to use them?
i.e: to use xpg4/bin/grep and usr/bin/grep
My OS version is SunOS 5.10
Regards,
Saps (7 Replies)
Discussion started by: saps19
7 Replies
4. OS X (Apple)
Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself.
But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Discussion started by: michellepace
1 Replies
5. UNIX for Dummies Questions & Answers
Hi!
All the basic linux commands, ie. echo, find, etc, are located in /bin. I have a couple of programs that have these commands pointed towards /usr/bin, ie, /usr/bin/echo (even though the actual 'echo' command is in /bin). How can I alias or redirect or link the /usr/bin to /bin just for this... (6 Replies)
Discussion started by: dancerat
6 Replies
6. Windows & DOS: Issues & Discussions
Hello, this is my first post and i hope you can solve my problem.
I need to create a batch file that will copy folder from hard drive on to usb stick on daily basis.
Can you help me and write that file and explaine me what to do next.
Folder's location is: c\windows\desktop\2009
Thank... (5 Replies)
Discussion started by: hule
5 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have a problem I don't understand with fuser.
I launch a simple shell script mysleep.sh:
I launch the command fuser -fu mysleep.sh but fuser doesn't return anything excepted:
mysleep:
Then I modify my script switching from #!/bin/sh to #!/bin/ksh
I launch the command fuser -fu... (4 Replies)
Discussion started by: Peuj
4 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
Can somebody tell me the difference between /bin, /usr/bin, /sbin ?
Thanx in advance,
Saneesh Joseph (3 Replies)
Discussion started by: saneeshjose
3 Replies
9. UNIX for Dummies Questions & Answers
I'm very new to unix and for the most part make my way around but I need to know how to create a batch file that can be ran at scheduled time. The main function of the file will be to copy files to different locations then FTP to a different server. Please help. I you have an example that would be... (2 Replies)
Discussion started by: spotanddot
2 Replies
10. UNIX for Dummies Questions & Answers
I just set up an ftp server with Red Hat 5.2. I am doing the work, I'm baby stepping, but it seems like every step I get stuck. Currently, I'm trying to set up a crontab job, but I'm getting the following message: /bin/sh: /usr/bin/vi: No such file or directory. I see that vi exists in /bin/vi,... (3 Replies)
Discussion started by: kwalter
3 Replies
MONGOWRITEBATCH(3) 1 MONGOWRITEBATCH(3)
The MongoWriteBatch class
INTRODUCTION
MongoWriteBatch is the base class for the MongoInsertBatch, MongoUpdateBatch and MongoDeleteBatch classes.
MongoWriteBatch allows you to "batch up" multiple operations (of same type) and shipping them all to MongoDB at the same time. This can be
especially useful when operating on many documents at the same time to reduce roundtrips.
Prior to version 1.5.0 of the driver it was possible to use MongoCollection::batchInsert, however, as of 1.5.0 that method is now discour-
aged.
Note: This class is only available when talking to MongoDB 2.6.0 (and later) servers. It will throw MongoProtocolException if attempting
to use it on older MongoDB servers.
CLASS SYNOPSIS
MongoWriteBatch
MongoWriteBatch
Constants
o const int$MongoWriteBatch::COMMAND_INSERT1
o const int$MongoWriteBatch::COMMAND_UPDATE2
o const int$MongoWriteBatch::COMMAND_DELETE3
Methods
o protected MongoWriteBatch::__construct (MongoCollection $collection, [string $batch_type], [array $write_options])
o public bool MongoWriteBatch::add (array $item)
o finalpublic array MongoWriteBatch::execute (array $write_options)
MONGOWRITEBATCH TYPES
o MongoWriteBatch::COMMAND_INSERT -Create an Insert Write Batch
o MongoWriteBatch::COMMAND_UPDATE -Create an Update Write Batch
o MongoWriteBatch::COMMAND_DELETE -Create an Delete Write Batch
DESCRIPTION
When executing a batch, by calling MongoWriteBatch::execute, MongoWriteBatch will send over maxWriteBatchSize (defaults to 1000) documents
or up to maxBsonObjectSize (defaults to 16777216 bytes), whichever comes first.
Note
Documents will never be partially transferred. When adding documents to the batch, that overflows the limit, a new batch will be
created and the document put into the new batch.
ERRORS
/EXCEPTIONS
oException on parameter parsing failures
oException on argument validation errors (e.g. missing keys)
oMongoProtocolException when talking to MongoDB server older then 2.6.0.
oMongoProtocolException on socket errors.
oMongoWriteConcernException when a write fails due to WriteConcerns
EXAMPLES
Example #1
MongoWriteBatch example
Adding documents to a Insert batch and then execute it
<?php
$mc = new MongoClient("localhost");
$collection = $mc->selectCollection("test", "test");
$docs = array();
$docs[] = array("my" => "demo");
$docs[] = array("is" => "working");
$docs[] = array("pretty" => "well");
$batch = new MongoInsertBatch($collection);
foreach($docs as $document) {
$batch->add($document);
}
$retval = $batch->execute(array("w" => 1));
var_dump($retval);
?>
The above example will output:
array(2) {
["nInserted"]=>
int(3)
["ok"]=>
bool(true)
}
PHP Documentation Group MONGOWRITEBATCH(3)