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::Indexing(3pm)					User Contributed Perl Documentation				    MongoDB::Indexing(3pm)

NAME
MongoDB::Indexing - Indexing collections CREATING AN INDEX
Unique and non-unique indexes can be created on collections using "MongoDB::Collection::ensure_index". For example, to create a non-unique index on "x": $collection->ensure_index({'x' => 1}) To create a unique index on "y": $collection->ensure_index({"y" => 1}, {"unique" => 1}); Multi-key indexes can be created to speed up queries like "sort by name, then by age." Index direction (1 or -1) is only important for multi-key indexes and should be the sort order. So, for example, if we want a fast sort by name ascending and age descending, we'd write: my $idx = Tie::IxHash->new(name => 1, age => -1); $collection->ensure_index($idx); Keep in mind that you should use Tie::IxHash for multi-key indexes to guarantee the keys will be saved in the correct order. Options The second parameter to "MongoDB::Collection::ensure_index" specifies index options. Available options are: "unique => boolean" By default, indexes are not unique. To create a unique index, pass "unique => true". "true" can be boolean::true or any other true value. "drop_dups => boolean" If a unique index is being created on an existing set of data that has duplicate values, creating the index will fail. To force the index creation by deleting duplicate values, use this option. Again, any value that evaluates to true will work. "safe => boolean" If the update fails and safe is set, this function will return 0. You should check "MongoDB::Database::last_error" to find out why the update failed. "background => boolean" Create the index as a background operation. "name => string" Give the index a non-default name. This can be useful if the index contains so many keys that you get an "index name too long" assertion, or if you just prefer a more human-readable name. See Also MongoDB documentation on indexing: <http://dochub.mongodb.org/core/indexes>. GEOSPATIAL INDEXES
Starting in version 1.3.3 of MongoDB, you can create geospatial indexes. These are useful for querying for "N documents nearest this point" or "documents within this shape." To create an index for geospatial queries, use "2d" instead of 1 or -1. For example, this would create an index on the "location" field: $coll->ensure_index({"location" => "2d"}); Then, you can query for documents using $near: my $cursor = $coll->query({"location" => {'$near' => [44, -70]}})->limit(10); This finds the 10 nearest documents (automatically sorted by distance ascending) to latitude -70, longitude 44. Documents must have some sort of pair in the "location" field, although the database is pretty flexible as to what it will accept: # valid geospatial locations $coll->insert({"location" => [44, -70]}); $coll->insert({"location" => {"x" => 44, "y" => -70}}); $coll->insert({"location" => {"foo" => 44, "bar" => -70}}); You can save values in "(x,y)" or "(y,x)" order, but you must be consistent. By default, the geospatial index assumes that points will lie between -180 and 180, for longitude and latitude queries. Options "min => int" By default, the geospatial index assumes that points will lie between -180 and 180, for longitude and latitude queries. If you need an alternative minimum value, you can use this option. This value is exclusive: if you specify "min => 0", you cannot save a point with a 0 value coordinate. "max => int" Alternative maximum value, exclusive. See Also MongoDB documentation on geospatial indexes: <http://dochub.mongodb.org/core/geo>. perl v5.14.2 2011-08-29 MongoDB::Indexing(3pm)
All times are GMT -4. The time now is 05:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy