UNIX Shell Script to Remove MongoDB Document-Based on Many inputs


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers UNIX Shell Script to Remove MongoDB Document-Based on Many inputs
# 1  
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!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question
MongoDB::GridFS(3pm)					User Contributed Perl Documentation				      MongoDB::GridFS(3pm)

NAME
MongoDB::GridFS - A file storage utility SYNOPSIS
use MongoDB::GridFS; my $grid = $database->get_gridfs; my $fh = IO::File->new("myfile", "r"); $grid->insert($fh, {"filename" => "mydbfile"}); There are two interfaces for GridFS: a file-system/collection-like interface (insert, remove, drop, find_one) and a more general interface (get, put, delete). Their functionality is the almost identical (get, put and delete are always safe ops, insert, remove, and find_one are optionally safe), using one over the other is a matter of preference. SEE ALSO
Core documentation on GridFS: <http://dochub.mongodb.org/core/gridfs>. ATTRIBUTES
chunk_size The number of bytes per chunk. Defaults to 1048576. prefix The prefix used for the collections. Defaults to "fs". files Collection in which file metadata is stored. Each document contains md5 and length fields, plus user-defined metadata (and an _id). chunks Actual content of the files stored. Each chunk contains up to 4Mb of data, as well as a number (its order within the file) and a files_id (the _id of the file in the files collection it belongs to). METHODS
get($id) my $file = $grid->get("my file"); Get a file from GridFS based on its _id. Returns a MongoDB::GridFS::File. put($fh, $metadata) my $id = $grid->put($fh, {filename => "pic.jpg"}); Inserts a file into GridFS, adding a MongoDB::OID as the _id field if the field is not already defined. This is a wrapper for "MongoDB::GridFS::insert", see that method below for more information. Returns the _id field. delete($id) $grid->delete($id) Removes the file with the given _id. Will die if the remove is unsuccessful. Does not return anything on success. find_one ($criteria?, $fields?) my $file = $grid->find_one({"filename" => "foo.txt"}); Returns a matching MongoDB::GridFS::File or undef. remove ($criteria?, $options?) $grid->remove({"filename" => "foo.txt"}); Cleanly removes files from the database. $options is a hash of options for the remove. Possible options are: just_one If true, only one file matching the criteria will be removed. safe If true, each remove will be checked for success and die on failure. This method doesn't return anything. insert ($fh, $metadata?, $options?) my $id = $gridfs->insert($fh, {"content-type" => "text/html"}); Reads from a file handle into the database. Saves the file with the given metadata. The file handle must be readable. $options can be "{"safe" =" true}>, which will do safe inserts and check the MD5 hash calculated by the database against an MD5 hash calculated by the local filesystem. If the two hashes do not match, then the chunks already inserted will be removed and the program will die. Because "MongoDB::GridFS::insert" takes a file handle, it can be used to insert very long strings into the database (as well as files). $fh must be a FileHandle (not just the native file handle type), so you can insert a string with: # open the string like a file my $basic_fh; open($basic_fh, '<', $very_long_string); # turn the file handle into a FileHandle my $fh = FileHandle->new; $fh->fdopen($basic_fh, 'r'); $gridfs->insert($fh); drop @files = $grid->drop; Removes all files' metadata and contents. all @files = $grid->all; Returns a list of the files in the database. AUTHOR
Kristina Chodorow <kristina@mongodb.org> perl v5.14.2 2011-09-07 MongoDB::GridFS(3pm)