08-18-2010
Thanks Ranjithpr and ctaylor.
I find the second suggestion better because it executes the query in one go. Thanks a lot for your help
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi, My account is : abcd
I belong to a group: pqrs
Some thing straneg happened yesterday.
My .cshrc and .login got overwritten into pqrs's .cshrc and .login
I obviously did not explicitly overwrite pqrs's .cshrc.
Are there any reasons how this could have happened indirectly due to... (5 Replies)
Discussion started by: gjthomas
5 Replies
2. UNIX for Dummies Questions & Answers
Hello,
One of my frend had a problem.
He had Windows XP installed on his system. Then he installed Red Hat Linux 8.0 in one of the partitions. After some time his XP got corrupt and then he reinstalled Windows XP. This over wrote the Grub loader entry, and due to this the grub loader is not... (2 Replies)
Discussion started by: rahulrathod
2 Replies
3. AIX
We have a problem where we delete a user and their associated UID gets dumped back in the UID pool. The if we immediately create a another (new) user, AIX reuses the last UID, the one that was just released. This is causing a problem when reports are being generated because the new users name is... (2 Replies)
Discussion started by: xsys2000
2 Replies
4. SCO
Due to my own stupidity I managed to overwrite my /dev/root device using dd (don't ask).
Current state is
- Have current backup created using cpio (command used was 'find . -mount -depth -print|cpio -ocB > $TAPE')
- Once I realised what was happening powered off the server but this was too... (2 Replies)
Discussion started by: ok2
2 Replies
5. HP-UX
The following files were wiped out - new empty files were left in their place.
/etc/inittab, /etc/inetd.conf, and /etc/MANPATH
The system is running HP-UX 11i v3 - Mar08.
Anyone seen anything like this?
Any ideas on a way to figure this out if it happens again or a suggested way to... (9 Replies)
Discussion started by: KEnglander
9 Replies
6. UNIX for Advanced & Expert Users
Hey peeps,
Here is somethin u might find interestin....
Is it possible to recover data from a partition which used to be an ext3 file sytem with some nice forgotten backups, which now is an lvm partion containg root partition of another OS. :)
I couldn't create any mess better than this, can... (2 Replies)
Discussion started by: squid04
2 Replies
7. Solaris
Hi,
The dump device on my system was set to /dev/dsk/c0t0d0s7. I have done a savecore -Lv on the system which worked fine. I'm wondering have I overwritten the rootdisk here by mistake? The system is still up but will need to be rebooted due to an error on it. Will it come back up?
... (8 Replies)
Discussion started by: gwhelan
8 Replies
8. Programming
Hi, i have some problems with the following code:
char *tab_path;
char *sep=" \t\n";
char line;
char *p;
FILE * file;
int i = 0;
if(fgets(line,MAXLINE,file)!=NULL){
if((p=strtok(line,sep))!=NULL)tab_path=p;
while((p=strtok(NULL,sep))!=NULL){
i++;
... (4 Replies)
Discussion started by: littleboyblu
4 Replies
9. Shell Programming and Scripting
Hi All,
I am new new to unix.com, I have a question related to shell scripting.
We have a Oracle database backup shell script, which can be used for taking full, incremental & archive log backup based on the parameters passed.
Within the script we export a variable as
export... (5 Replies)
Discussion started by: veeresh_15
5 Replies
10. UNIX for Advanced & Expert Users
I had generated a ssh2 key on my AIX box, to receive files from other AIX and Linux systems.
Key Name: id_ssh2_server.pub
However this ssh2 key (both public and private keys) has been overwritten, while I was generating another ssh2 key. Now the earlier configured target systems are not able... (3 Replies)
Discussion started by: freakygs
3 Replies
LEARN ABOUT PHP
mongocursor.timeout
MONGOCURSOR.TIMEOUT(3) 1 MONGOCURSOR.TIMEOUT(3)
MongoCursor::timeout - Sets a client-side timeout for this query
SYNOPSIS
public MongoCursor MongoCursor::timeout (int $ms)
DESCRIPTION
A timeout can be set at any time and will affect subsequent queries on the cursor, including fetching more results from the database.
PARAMETERS
o $ms
- The number of milliseconds for the cursor to wait for a response. Use -1 to wait forever. By default, the cursor will wait
$30000 milliseconds (30 seconds).
RETURN VALUES
This cursor.
ERRORS
/EXCEPTIONS
Causes methods that fetch results to throw a MongoCursorTimeoutException if the query takes longer than the specified number of millisec-
onds.
EXAMPLES
Example #1
MongoCursor.timeout(3) example
In the following example, the driver will wait forever for the initial database response, and then wait 100ms for subsequent
responses.
<?php
$cursor = $collection->find();
$cursor->timeout(-1);
/* $cursor->hasNext() executes the query. An infinite timeout has been set, so
* the driver will wait as long as necessary for a response.
*/
while ($cursor->hasNext()) {
$cursor->timeout(100);
/* A timeout has now been set, so if the cursor needs to get more results
* from the database, it will only wait 100ms for a response.
*/
try {
print_r($cursor->getNext());
} catch (MongoCursorTimeoutException $e) {
echo "query took too long!";
}
}
?>
NOTES
Warning
This does not cause the MongoDB server to cancel long-running operations; it only instructs the driver to stop waiting for a
response and throw a MongoCursorTimeoutException after a set time. If you need to specify a server-side timeout for a query, con-
sider using MongoCursor::maxTimeMS.
SEE ALSO
MongoCursorInterface::timeout, The socketTimeoutMS option for MongoClient.__construct(3).
PHP Documentation Group MONGOCURSOR.TIMEOUT(3)