Sponsored Content
Top Forums UNIX for Beginners Questions & Answers UNIX Shell Script to Remove MongoDB Document-Based on Many inputs Post 303042589 by Neo on Tuesday 31st of December 2019 06:36:11 AM
Old 12-31-2019
Please provide a lot more details, for example your operating system, version, and exact shell and version.

Also, if you provide your entire script, versus a tiny fragment of it, you will get better responses.

Happy New Year 2020!
 

10 More Discussions You Might Find Interesting

1. Programming

UNIX Shell Script to Create a Document of a PLSQL code.

Hi All, I am supposed to present the documentation for the PLSQL code (PACKAGES, PROCEDURE, FUNCTIONS) of my application. There are sufficient comments in my code. Has anyone written any Shell Script Utility which can parse the PLSQL code and generate some kind of document ( preferrably HTML not... (1 Reply)
Discussion started by: gauravsachan
1 Replies

2. Shell Programming and Scripting

passing argument to shell script that reads user inputs

Hi, Lets say I have a script "ss" which does this read abc echo $abc read pqr echo $pqr Now if I want to pass and argument to only "abc" how do I do it. If I do echo "somevalue" | ss, it does not prompt for pqr and its value comes out as blank. Any help is appreciated Thanks P (6 Replies)
Discussion started by: patjones
6 Replies

3. Shell Programming and Scripting

Need inputs on UNIX script basics

Hi UNIX Gurus, I have a SQL utility which fires DML statements against DB2 tables. Logic is to identify DML statements, put it into a file ($dml) and execute the job. DML file can have more than 1 DML statements....but all of 1 type at a time.....either all UPDATE or all DELETE. Job first... (2 Replies)
Discussion started by: ustechie
2 Replies

4. Shell Programming and Scripting

Perl script for taking inputs from one script and storing them into a document.

Hi. I wanted to create a Perl script which can take the outputs of a Perl script as it's input and temporarily store them in a document. Need help. Thanks.:) (8 Replies)
Discussion started by: xtatic
8 Replies

5. Shell Programming and Scripting

Need a shell script which takes two inputs and copy the files from one directory to other

Hi, I am using solari 10 OS which is having bash shell. I need a shell script which takes user home directory and name of the file or directory as a input and based on that copy the files accordingly to the other directory. example:I hava a machine1 which is having some files in a... (8 Replies)
Discussion started by: muraliinfy04
8 Replies

6. Shell Programming and Scripting

Script which takes two inputs based on that execute othe scripts

Hi, I am using solaris 10 bash shell.this might a small script but i am not much familiar with scripting. My requirement here is script should prompt for users two opions like this "please select either any one option makefile or make& build file". if the user selects make file option... (2 Replies)
Discussion started by: muraliinfy04
2 Replies

7. UNIX for Dummies Questions & Answers

How to give multiple inputs to a shell script

Got struck while trying to write a shell script which should automatically give input. While running a script for eg: (adpatch.sh) It Prompts for Multiple inputs like: Do you currently have files used for installing or upgrading the database installed in this APPL_TOP ? need to give... (2 Replies)
Discussion started by: abdmoha
2 Replies

8. UNIX for Dummies Questions & Answers

How to send keyboard inputs toa UNIX command executed from a shell script?

I have a unix command that prompts for 'y'. How do I run this from my shell script? (4 Replies)
Discussion started by: Sree10
4 Replies

9. Shell Programming and Scripting

HERE Document in Shell Script

Hi, I have a shell script to install one of our products. It comprises of commands that are specific to the product installation. These commands require user inputs at different stages. To avoid manual feeding of inputs every time, I tried using HERE document. it is like- #! /usr/bin ... (1 Reply)
Discussion started by: nishant.kansal@
1 Replies

10. Shell Programming and Scripting

Shell script inputs to python

Hi I am trying to pass 2 input parameters from shell script to python API end point ,but not passing what i expected when print those inputs .Please advise data.txt " 7554317" ,xx5e1 " 7554317" ,xx96 " 7554317" ,xxd6 " 554317" ,xde cat $sites/data.txt |sort |uniq >$sites/a.txt... (5 Replies)
Discussion started by: akil
5 Replies
MONGODB(3)								 1								MONGODB(3)

The MongoDB class

INTRODUCTION
Instances of this class are used to interact with a database. To get a database: Example #1 Selecting a database <?php $m = new MongoClient(); // connect $db = $m->selectDB("example"); ?> Database names can use almost any character in the ASCII range. However, they cannot contain " ", "." or be the empty string. The name "system" is also reserved. A few unusual, but valid, database names: "null", "[x,y]", "3", """, "/". Unlike collection names, database names may contain "$". CLASS SYNOPSIS
MongoDB MongoDB Constants o const int$MongoDB::PROFILING_OFF0 o const int$MongoDB::PROFILING_SLOW1 o const int$MongoDB::PROFILING_ON2 Fields o public integer$w1 o public integer$wtimeout10000 Methods o public array MongoDB::authenticate (string $username, string $password) o public array MongoDB::command (array $command, [array $options = array()], [string &$hash]) o public MongoDB::__construct (MongoClient $conn, string $name) o public MongoCollection MongoDB::createCollection (string $name, [array $options]) o public array MongoDB::createDBRef (string $collection, mixed $document_or_id) o public array MongoDB::drop (void ) o public array MongoDB::dropCollection (mixed $coll) o public array MongoDB::execute (mixed $code, [array $args = array()]) o public bool MongoDB::forceError (void ) o public MongoCollection MongoDB::__get (string $name) o public array MongoDB::getCollectionInfo ([array $options = array()]) o public array MongoDB::getCollectionNames ([array $options = array()]) o public array MongoDB::getDBRef (array $ref) o public MongoGridFS MongoDB::getGridFS ([string $prefix = "fs"]) o public int MongoDB::getProfilingLevel (void ) o public array MongoDB::getReadPreference (void ) o public bool MongoDB::getSlaveOkay (void ) o public array MongoDB::getWriteConcern (void ) o public array MongoDB::lastError (void ) o public array MongoDB::listCollections ([array $options = array()]) o public array MongoDB::prevError (void ) o public array MongoDB::repair FALSE FALSE ([bool $preserve_cloned_files], [bool $backup_original_files]) o public array MongoDB::resetError (void ) o public MongoCollection MongoDB::selectCollection (string $name) o public int MongoDB::setProfilingLevel (int $level) o public bool MongoDB::setReadPreference (string $read_preference, [array $tags]) o public bool MongoDB::setSlaveOkay ([bool $ok = true]) o public bool MongoDB::setWriteConcern (mixed $w, [int $wtimeout]) o public string MongoDB::__toString (void ) PREDEFINED CONSTANTS
MONGODB LOG LEVELS
o MongoDB::PROFILING_OFF - 0 - Profiling is off. o MongoDB::PROFILING_SLOW - 1 - Profiling is on for slow operations (>100 ms). o MongoDB::PROFILING_ON - 2 - Profiling is on for all operations. FIELDS
o $w -1 - The number of servers to replicate a change to before returning success. Inherited by instances of MongoCollection derived from this. w functionality is only available in version 1.5.1+ of the MongoDB server and 1.0.8+ of the driver. w is used when- ever you need to adjust the acknowledgement level (MongoCollection.insert(3), MongoCollection.update(3), MongoCollec- tion.remove(3), MongoCollection.save(3), and MongoCollection.ensureIndex(3) all support this option). With the default value (1), an acknowledged operation will return once the database server has the operation. If the server goes down before the operation has been replicated to a secondary, it is possible to lose the operation forever. Thus, you can specify w to be higher than one and guarantee that at least one secondary has the operation before it is considered successful. For example, if w is 2, the primary and one secondary must have a record of the operation or the driver will throw a MongoCursorException. It is tempting to set w to the total number of secondaries + primary, but then if one secondary is down the operation will fail and an exception will be thrown, so usually w=2 is safest (primary and one secondary). o $wtimeout -10000 - The number of milliseconds to wait for MongoDB::$w replications to take place. Inherited by instances of MongoCollection derived from this. w functionality is only available in version 1.5.1+ of the MongoDB server and 1.0.8+ of the driver. Unless wtimeout is set, the server waits forever for replicating to w servers to finish. The driver defaults to waiting for 10 seconds, you can change this value to alter its behavior. SEE ALSO
MongoDB core docs on databases. PHP Documentation Group MONGODB(3)
All times are GMT -4. The time now is 02:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy