good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Creating a perl delete statement with MongoDBby e0s (Novice) |
on Jul 20, 2017 at 12:44 UTC ( [id://1195603]=perlquestion: print w/replies, xml ) | Need Help?? |
e0s has asked for the wisdom of the Perl Monks concerning the following question: I am having difficulty creating a perl MongoDB delete statement that will select from EITHER one table or another, depending on the TYPE of input from the user. Let's say the databases are $FRUITS and each fruit is categorized into tables either by their 'fruit_names' or unique 'fruit_ids' Let's say the user wants to delete an entry from the fruit_names table, how do I configure my perl code so that it can differentiate between one input versus another? I've searched cpan.org and found some MongoDB documentation on delete_one and delete_many but I haven't been able to figure out how I would create a delete_one statement that would pull from either one table or the other, depending on the user's input. I am a novice with perl still and I've never used MongoDB before, i've been really stuck on this for a while so any help would be greatly, greatly appreciated.
Back to
Seekers of Perl Wisdom
|
|