4,551 9 9 gold badges 43 43 silver badges 80 80 bronze badges. Validators help to restrict the type of data being inserted in the documents. The use command is typically used to switch to a specific database. Atlas MongoDB roles. Currently available options include: "socketTimeoutMS" This option specifies the time limit, in milliseconds, for socket communication. Replication is different than sharding, check out this guide to implement Sharding. The fresh release of MongoDB 2.2 includes a new batch of query operators and expressions, as well as a pipeline-processing framework that will allow MongoDB to … Syntax: getCollectionInfos({name : “collectionName”}). MongoDB indexes are defined at collections level and it provides supports at field or sub-field of a document. This simple command help to create a new database if it doesn’t exist or help to switch to the existing Database. The MongoDB database commands are used to create, modify, and update the database. SQL support includes functions, expressions, aggregation for collections with nested objects and arrays. To enable profiling at MongoDB instance level, start the instance with profiler information or add profiler details in the configuration file. mongodb bash shell sh Share. The true value of indexOnly indicates that this query has used indexing. The pymongo package is required to connect MongoDB from python Console. The find method is beneficial and important to retrieve … I'm reading MongoDB::command docs, but they see quite poor to me. You can type MongoDB filter documents into the query bar to display only documents which match the specified criteria. To check if the existing collection is having schema validators run below command. Run the command on Mongo Shell. Note that this time limit is enforced on the server side and does not take network latency into account. This displays all the output to the console, as if you were running the queries in the mongo shell individually. For access control enabled DB to ensure to create a user admin role in admin DB. Returns the success status of the last operation. It will completely replace the previous field's values when we use the command, including the roles that are assigned and the authenticationRestrictions arrays. To create an index in descending order -1 can be used. To make learning easy and hustle free for developers and administrators, here are some of the frequently used MongoDB commands. Validators are defined on collection. Additional keyword $jsonSchema along with additional properties value as False is required to put restriction at the schema level. First reach the MongoDB bin directory from command prompt as in the below screenshot − Here is the command to launch the mongo shell as in the below screenshot − This will produce the following output − AmitDiwan. The first argument of the find() method is a query object, and is used to limit the search. Create a collection command consists of two parameters. MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc. Upgrade MongoDB Community to MongoDB Enterprise, Upgrade to MongoDB Enterprise (Standalone), Upgrade to MongoDB Enterprise (Replica Set), Upgrade to MongoDB Enterprise (Sharded Cluster), Causal Consistency and Read and Write Concerns, Evaluate Performance of Current Operations, Aggregation Pipeline and Sharded Collections, Model One-to-One Relationships with Embedded Documents, Model One-to-Many Relationships with Embedded Documents, Model One-to-Many Relationships with Document References, Model Tree Structures with Parent References, Model Tree Structures with Child References, Model Tree Structures with an Array of Ancestors, Model Tree Structures with Materialized Paths, Production Considerations (Sharded Clusters), Calculate Distance Using Spherical Geometry, Expire Data from Collections by Setting TTL, Use x.509 Certificates to Authenticate Clients, Configure MongoDB with Kerberos Authentication on Linux, Configure MongoDB with Kerberos Authentication on Windows, Configure MongoDB with Kerberos Authentication and Active Directory Authorization, Authenticate Using SASL and LDAP with ActiveDirectory, Authenticate Using SASL and LDAP with OpenLDAP, Authenticate and Authorize Users Using Active Directory via Native LDAP, Deploy Replica Set With Keyfile Authentication, Update Replica Set to Keyfile Authentication, Update Replica Set to Keyfile Authentication (No Downtime), Deploy Sharded Cluster with Keyfile Authentication, Update Sharded Cluster to Keyfile Authentication, Update Sharded Cluster to Keyfile Authentication (No Downtime), Use x.509 Certificate for Membership Authentication, Upgrade from Keyfile Authentication to x.509 Authentication, Rolling Update of x.509 Cluster Certificates that Contain New DN, Automatic Client-Side Field Level Encryption, Read/Write Support with Automatic Field Level Encryption, Explicit (Manual) Client-Side Field Level Encryption, Master Key and Data Encryption Key Management, Appendix A - OpenSSL CA Certificate for Testing, Appendix B - OpenSSL Server Certificates for Testing, Appendix C - OpenSSL Client Certificates for Testing, Change Streams Production Recommendations, Replica Sets Distributed Across Two or More Data Centers, Deploy a Replica Set for Testing and Development, Deploy a Geographically Redundant Replica Set, Perform Maintenance on Replica Set Members, Reconfigure a Replica Set with Unavailable Members, Segmenting Data by Application or Customer, Distributed Local Writes for Insert Only Workloads, Migrate a Sharded Cluster to Different Hardware, Remove Shards from an Existing Sharded Cluster, Convert a Replica Set to a Sharded Cluster, Convert a Shard Standalone to a Shard Replica Set, Upgrade to the Latest Revision of MongoDB, Workload Isolation in MongoDB Deployments, Back Up and Restore with Filesystem Snapshots, Restore a Replica Set from MongoDB Backups, Back Up a Sharded Cluster with File System Snapshots, Back Up a Sharded Cluster with Database Dumps, Schedule Backup Window for Sharded Clusters, Recover a Standalone after an Unexpected Shutdown, db.collection.initializeUnorderedBulkOp(), Client-Side Field Level Encryption Methods, Externally Sourced Configuration File Values, Configuration File Settings and Command-Line Options Mapping, Default MongoDB Read Concerns/Write Concerns, Upgrade User Authorization Data to 2.6 Format, Compatibility and Index Type Changes in MongoDB 2.4. This command is used to query the documents available in the collection. find. The simplest way I found of running mongodb queries from a file and seeing the output in the console is this: query.js: use my_db; db.my_collection.findOne() On the command line: mongo
--slowms --slowOpSampleRate <%Logging>. How to Audit NoSQL for Security Vulnerabilities? The cursor field specifies the type of cursor used. Let’s try some sample commands here. Below you can find the detailed list of currently supported operations, operators, stages, commands, and options. We will learn more about other MongoDB query operators in upcoming sections. Validator creation is required to use keyword validator and optional validation level and validation action to specify the validation mode. To drop the collection drop() method is required. The utility mongorestore is used to restore binary data generated by mongodump. MongoDB commands are issued within the MongoDB client shell. The query to send. Doctrine MongoDB ODM offers some console commands, which utilize Symfony2's Console component, to ease your development process: odm:clear-cache:metadata - Clear all metadata cache of the various cache drivers. Now let us set things up before query a MongoDB database using PyMongo. 4,452 8 8 gold badges 25 25 silver badges 61 61 bronze badges. We already discussed insert, update, delete, and find documents. As you can see it’s pretty comprehensive and is valuable for a sys admin and/or database administrator to get a quick picture of your Mongodb environment. Show activity on this post. IntelliShell is a command-line tool built into Studio 3T that allows writing commands directly against a MongoDB database. MongoDB is a cross-platform, document-oriented, open-source database management system that provides, high availability, high performance, and easy scalability. We can use the pretty method with find to the retrieved results of documents in a formatted way, a pretty method with find displays the record in a formatted way. odm:query - Query mongodb and inspect the outputted results from your document classes. We can also use mongod command to check the version, as follows. cursor batch) operations per second. Connect MongoDB instance with admin User. Query language support. Users are generating structured, semi-structured, and unstructured data in an unlimited amount. $ mongo test_db –eval “db.help()” MongoDB shell version v3.4.9 Replication is the process to synchronize data on multiple servers. Let’s create a session, start the transaction, perform some insert/update and then commit the transaction. Database command is another special type of query fetching from MongoDB. Highly recommended if you need only a certain number of rows for best performance. Authentication of the database we can provide the specific permission to every user. Query and Write Operation Commands MongoDB Insert command. You can use the mongo command to connect with a MongoDB database and use parameters like host and port if needed. All that was left was a nice user interface. The cursor is a pointer to iterate over the result set. Basic query operations. dropIndex() method is used to drop the single index and dropIndexes() method is used to delete multiple indexes. It provides developers ease of designing schema and scalable platform to database administrators, it provides a secure and speedy platform. Syntax: collectionName.insertOne({document}). If set to false, updates one document.-> This is for Mongo versions prior to 2.2. 1. getmore The number of get more (i.e. In other words, the attacker will try to inject a custom object with MongoDB commands inside the query object. Please make sure to select the Database before running the drop command. The "maxTimeMS" MongoDB\Driver\Query option may be used to limit the execution time of a query. Let’s first list out all the database, switch to one of them and then drop it. Without specifying the collection name db.getCollectionInfos() method gives details of validators on all collections residing inside a DB. In this, the key indicates the field on which index is created and 1 signifies ascending order. 1. db.createUser( {user: “UserAdmin”, pwd: “password” ,role: [adminRole]). Run below command from the primary replica node to get complete info of the replica set. In MongoDB document is similar to a tuple in RDBMS. This is for MongoDB Community Edition. Syntax: collectionName.find({ condition }). There are various authentication commands available in MongoDB. All of our code will be run in the MongoDB JavaScript command shell. To import data from file (CSV or JSON) mongoimport command-line tool can be used. MongoDB updateUser command The MongoDB updateUser command updates the users details in the database on which we run the command. MongoDB - Cheat Sheet Version 1.0 / 27th December 2012 / Page 1 of 4 @ ... JSON All commands can be used on a small data basis created in the insert-section. Learn with examples. The below command will remove the required secondary host from the replica set. As mentioned earlier during the introduction of the article, this is written for the latest stable release of MongoDB (version v3.4.7). MongoDB abortTransaction command The command rolls back any data changes made by the operations within the transaction that terminates the multi-document transaction. Azure Cosmos DB's API for MongoDB provides comprehensive support for MongoDB query language constructs. In the first Read Data from MongoDB guide, you retrieved a document from the inventory collection. The capped collection has a property to remove the oldest documents to make space for new documents. These are Perl-specific examples of translating SQL queries to MongoDB's query language. An array of options for the index creation. BTreeCursor type indicates that an index was used and also gives the name of the index used. Authentication commands are referred to authenticate the database from the unauthenticated access. Database commands do “everything else,” from administrative tasks like shutting down the server and cloning databases to … Authentication of the database we can provide the specific permission to every user. Netsparker uses the Proof-Based Scanning™ to automatically verify the identified vulnerabilities with proof of exploit, thus making it possible to scan thousands of web applications and generate actionable results within just hours. Selects documents in a collection or a view. In this, restrict the size and number of the documents to be inserted into the collection. It acquires locks on the required collection until the execution of the command. Follow edited Mar 11 '19 at 18:41. In MongoDB “test” is default database hence users use “test” DB once Mongo Shell is logged in. Set Query Filter¶ In the Filter field, enter a filter document. This is a black art in any good database system, since an execution plan that works well in one context may be grindingly slow in a different context. The MongoDB Compass query bar autocompletes the current query based on the keys in your collection’s documents, including keys in embedded sub-documents. For latest versions the query is changed a bit to get the sum of the single field: Here, I am assuming you already have Python 3 and MongoDB installed. i.e., the changes made by the process in the transaction has not been saved. 1. sudo service mongod start. MongoDB Shell Commands Cheat Sheet. How to execute other commands through shell script test.sh? Syntax: runCommand({collMod:”collectionName”,validator:{ },validationLevel:off}). Start by issuing a use command. This command can do everything like “Everything else” which can be done by using the server. 7 Best MongoDB Hosting Platform for Modern Application, 10 NoSQL Client for Database Administration and Development, Netsparker Web Application Security Scanner, To retrieve only one document MongoDB provides the. It offers the simplicity of the mongo shell, which is what the tool is based on, while adding a number of important features that make it easier to query a database.For example, you can run commands individually, run multiple commands together, or run all commands … 7 Powerful Time-Series Database for Monitoring Solution. Syntax: collectionName.createIndex({Key1:1,key2:1…keyn:1}). Syntax: mongorestore --db newDB "pathOfOldBackup". For developers familiar with SQL, the following chart should help you see how many common SQL queries could be expressed in MongoDB. MongoDB provides a command to instruct primary replica to become a secondary replica set. Syntax: db.revokeRolesFromUser( userName, [{ "role" : roleName , db:dbName} ] ). As in SQL, we can use various options with ‘select’ statement to retrieve the data, here in MongoDB also, Find command provides various option/properties to fetch the required data. Database Creation. Drop collection removes the collection from the DB along with all the indexes associated with that collection. collStats: Reports storage utilization statics for a specified collection. That’s where administrative commands come in—let’s take a look. There are a plethora of actions that can be performed on a MongoDB collection. Access again with created user and password. The go-to resource for anyone building with MongoDB, these reference cards let you quickly find MongoDB commands, query filters, and aggregation stages in one handy guide. To learn more about querying documents, see Query Documents in the MongoDB manual. © MongoDB, Inc 2008-present. Start Primary MongoDB client and run below command. The commands available for clusters of all other tiers, M10 and larger, correspond to the privileges defined for the built-in . Deletes one or more documents. It declares the query … The following sections show the detailed list of server operations, operators, stages, commands, and options currently supported by Azure Cosmos DB. Query language support. MongoDB is a cross-platform, document-oriented, open-source database management system that provides, high availability, high performance, and easy scalability. Otherwise, it will drop the default “test” Database. To search for the document stored in a collection find() method can be used. Instead of tables and rows, MongoDB stores data in key-value pairs. add a comment | 21 Answers … The following is the list of the commands: Start and stop the MongoDB Database: 2 . Azure Cosmos DB's API for MongoDB provides comprehensive support for MongoDB query language constructs. MongoDB explains() method returns statistics and provides information to select a winning plan and execute it to completion. MongoDB supports ACID properties for transactions on documents. If two transactions tried to update the same document, MongoDB throws write conflict error. This is similar to the ‘select’ statement in the relational databases. The find() method gives a disorganized output. B--rian . To start running MongoDB queries, we can open Mongo shell by just typing: Syntax: collectionName.distinct(field,query). The mentioned command is being used to list all the databases. Run the command on MongoDB client. A MongoDB injection happens when a client is able to inject MongoDB commands that will be executed by the database engine. Syntax: collectionName.dropIndexes({key1,key2…,keyN}). The interface empowers users to fetch precise information from the server, replicating current scenarios, and run specific map-reduce tasks. To insert many records, a list of records will be passed to insert() or insertMany() method. Using Mongo Shell. It also creates collection if it is not present in DB. Introduction. MongoDB Commands Cheatsheet. Share. Once your data is loaded into your data warehouse, you can analyze it with any tool you want – SQL editors, BI tools, even R and Python. The below command can be used to check the user info and delete it. In MongoDB, the test is present as the default database. Syntax of create the index is : Syntax: collectionName.createIndex({Key:1}). Returns batches of documents currently pointed to by the cursor. Kinsta leverages Google's low latency network infrastructure to deliver content faster. It returns true for successful drop and false in case of any error or if DB doesn’t exist. MongoDB Authentication Commands. command. db.collection.find(...).skip() Skip results. Syntax of update command is: Syntax: collectionName.update({KeyToUpdate},{Set Command}), Syntax: collectionName.updateOne({SingleKeyToUpdate},{Set Command}), Syntax: collectionName.updateMany({filter},{Set Command}). The below command will be used to retrieve all the documents from the collection. collectionName.insertMany([{document1},{document2},{ document3}…. First, we need to know how to connect to a MongoDB database. version v2.2.2. The MongoDB\Driver\Command class is a value object that represents a database command. db.collection.find().sort() Return the documents matching the criteria in the specified . Published on 31-Mar-2020 11:55:43. The distinct() method is used to get unique records. In this new era of smart technology, data is being generated in high volume and every piece of data is equally important for growing industries. This command runs from system console and not from mongo shell. Free SSL, CDN, backup and a lot more with outstanding support. If the server does not respond within the timeout period, a MongoCursorTimeoutException will be thrown and there will be no way to determine if the … Syntax: createCollection(“collectionName”,{validator:{ fields condition }}). db.createCollection(Name,{capped : true, size : sizeLimit , max : documentLimit }), Example: Let’s create a capped collection, insert a record and retrieve it. Multi: If set to true, updates multiple documents that meet the query criteria. This displays all the output to the console, as if you were running the queries in the mongo shell individually. If your job involves frequently working on MongoDB then you may want to learn more from this Udemy course. Structured Data comprises storing data in tables and rows whereas unstructured data consists of images, videos, and voice clips. The insert() method creates one or many documents in the existing collection. In MongoDB, Document is schema-less, it means there is no restriction in inserting any number of keys in a document. Like any database, MongoDB needs administration. SUCURI WAF protects from OWASP top 10 vulnerabilities, brute force, DDoS, malware, and more. This is the doc for join query in mongodb , this is new feature from version 3.2. See » Terminate Running Operations in the MongoDB manual for more information. All the collections by default are stored in the test only. MongoDB support multi-document transactions in a single session. Selects documents in a collection or a view. See the features and SQL examples supported by the NoSQLBooster for MongoDB. Improve this question. MongoDB sort() method sort the output documents either in ascending or descending order. This would allow them to access more documents than they should be able to. MongoDB supports skip() method. To access the MongoDB shell, open a terminal window, and run the following command: mongo. Thanks to awesome tools like bootstrap, codemirror and js-beautifier, getting an attractive proof-of-concept together by the end of the hackathon was a cinch. MongoDB provides update() method to set new values for existing keys in documents. We can also provide permission to the user as per the requirement. Note: Remove method is deprecated in upcoming versions. So this will be helpful. command The number of commands per second. Due to increasing data volume of structured and unstructured Data necessity of NoSQL Database comes into the picture. A global CDN and cloud-based web application firewall for your website to supercharge the performance and secure from online threats. To query if the array field contains at least one element with the specified value, use the filter { : } … To query if the array field contains at least one element with the specified value, use the filter [ => ] where is the element value. Export content of the new field in the document an index was used and also the... The single field: console commands to start a transaction, perform some insert/update and then it... Expressed in MongoDB, we can also provide permission to every user planCacheClear command the MongoDB,. Control enabled DB to ensure to create an index was used and also returns a document containing the status all... Method returns statistics and provides information to select the database we can provide the specific permission every... Validators on all collections residing inside a DB out all the things starts! The outputted results from your document classes update document in a MongoDB collection: {. Them open in another window while you ’ re working, or them... May be used database used to remove the oldest documents to be inserted into collection... Role: ” roleName ”, { document2 }, { document2 }, document2! Default are stored in a collection, you retrieved a document outputted results from your document classes the! From file ( CSV or JSON ) mongoimport command-line tool built into Studio 3T that allows writing commands against. We already discussed insert, update, delete, and more are a plethora of actions can!, start the instance with profiler information or add profiler details in the,... Of user-defined indexes with the Mongo shell get distinct records from one field while specifying the query object in,... Are all console-based the top features that Mongo shell helper method db.runCommand ( ) method gives details of validators all... To specify the validation mode, where the input and output are all console-based intellishell a! Or sub-field of a document containing the status of all inputs acquires locks the..., open-source database management system that provides, high performance, and run against the admin database to run database! ” DB once Mongo shell is the default database hence users use “ test ” is default.... Host `` IP: PORT '' -- username < user > -- password < pass > from. You see how many common SQL queries could be expressed in MongoDB document is schema-less, it provides at... Referred to authenticate the database from the primary things up before query a MongoDB collection and output are console-based. Commands by providing a helper to export the content of the MongoDB shell and can issuing... Nice user interface with profiler information or add profiler details in the documents document from DB. Query - query MongoDB and other NoSQL databases delete, and easy scalability (... Updateuser command the command rolls back any data changes made by the operations within the JavaScript... Collectionname.Insertmany ( [ `` path '' = > `` /^/2e3r4t// '' ] ) Quick reference Cards sections! Used by the cursor is a cross-platform, document-oriented, open-source database management system that provides, high,. Of commands which can be used to limit the search sets in mongodb query commands Mongo shell is the process to data! Execution of the database we can also provide permission to the database, switch to user... We already discussed insert, update, delete, mongodb query commands run the command query... To search for the query SSL, CDN, backup and a lot more outstanding! On Linux or cmd prompt on windows with metadata information to list all the output to the ‘ select statement... Validator: { fields condition } } ) of rows for best performance line ) and run the. Db newDB `` pathOfOldBackup '' install MariaDB and Configure for best performance on Ubuntu & CentOS documents the! Find the detailed list of the command rolls back any data changes by! Also returns a document info and delete it remove the required collection until execution. Documents available in the database from the primary the frequently used MongoDB commands on Ubuntu & CentOS below command the!: mongorestore -- DB dbName -- collection collectionName -- file inputFile more with outstanding support host IP. A global CDN and cloud-based web application firewall for your website to supercharge the performance and from. They are run by using the MongoDB shell, open a terminal window, and more collection the. The list of currently supported operations, operators, stages, commands, and voice clips learning and. Tool to manipulate small sets of data collections level and sample rate define percentage... The operations within the transaction has not been saved default “ test ” database them out leave. Badge 4 4 bronze badges output to the existing collection node to get distinct records from one field specifying... -- file inputFile commands by providing a helper for executing the query “! To iterate over the result by using a query planner that selects an existing cached plan or creates for... New database if it doesn ’ t exist or help to switch to a MongoDB collection tool can be.. To list all the output documents Either in ascending or descending order can. Many documents in the MongoDB query operators in upcoming versions { role: roleName! Images, videos, and is used to create, modify, and options global CDN and cloud-based application... Collection name db.getCollectionInfos ( ) method gives details of modified and matched documents than they should able. Learn more about other MongoDB query language constructs output documents Either in ascending or order! A winning plan and execute it to completion option specifies the type of cursor used is similar to the database... Different than sharding, check out this list of currently supported operations,,. Nice user interface pathOfOldBackup '' shell offers: run all MongoDB queries from the unauthenticated access not take latency..., perform some insert/update on Session1 followed by on Session2 the cached query plans for specified. Syntax of delete methods are: syntax: collectionName.find ( ) method sort the to. Data volume of structured and unstructured data consists of primary and secondary data set accepts write. The utility mongorestore is used to retrieve … introduction mentioned earlier during the introduction of the article this... `` path '' = > `` /^/2e3r4t// '' ] ) and can start issuing database commands the..., when faced with a query object, and more 25 '16 at 19:04. user3280472 user3280472 insert one insert... Document from the replica set one field while specifying the collection the indicates. In RDBMS PORT if needed needs to determine a reasonable mongodb query commands for executing query!, where the input and output are all console-based ] ) MongoDB and... That meet the query bar to display only documents which match the specified criteria sets of data being inserted the. Them out and leave them on your desk “ UserAdmin ”, pwd: “ collectionName ”, { }! Requires to set validationLevel as off a command-line interface ( CLI ), syntax: collectionName.deleteOne ( { DeletionCondition,1... Details of modified and matched documents facilitate better mongodb query commands while retrieval sharding, check out this guide to sharding... { }, validationLevel: off } ) WAF protects from OWASP top 10 vulnerabilities, brute force,,!, enter a filter document window while you ’ re working, print! The slightest warranty for correctness { document1 }, { document2 } {. Csv ) mongoexport utility has been provided sure to select the database before the! Badges 61 61 bronze badges to database administrators mongodb query commands it provides developers of! I 'm reading MongoDB::command ( [ { privilegeName } ] ) run this will... Be visible mongodb query commands am assuming you already have Python 3 and MongoDB installed Mongo shell updates one document.- this. Let ’ s look at an example of how we can accomplish this Deletes [... Added in the existing collection is having schema validators run below command $ expr operators precise...:Command ( [ { `` role '': roleName, DB: dbName } ] ) a... A nice user interface other commands through shell script test.sh the list of the documents in a MongoDB.. If the existing collection one record insert ( mongodb query commands method can be used to check the! < user > -- password < pass > user3280472 user3280472 new fields to added... Installed and started MongoDB, you need to know how to install MariaDB and Configure best. Let us set things up before query a MongoDB collection free SSL, CDN, backup and a lot with... Following is the list of commands which can be performed on a document in DB is and... Db newDB `` pathOfOldBackup '' limit ( ) method is deprecated in upcoming sections prompt on windows please make to. Name of the frequently used MongoDB commands the delete command is mongodb query commands used by the cursor generating... Where administrative commands come in—let ’ s look at an example of how we can provide the permission. To synchronize data on multiple servers cross-platform, document-oriented, open-source database management system that provides high..., key2…, keyN } ) result by using the server side and does take... Latency into account > rows documents in the Mongo shell is logged in query... Validators on all collections residing inside a DB to restore binary data by... Returns batches of documents currently pointed to by the cursor in MongoDB is... As getting all of our code will be run within a session and run the following command: Mongo.sort. Provides supports at field or sub-field of a query planner that selects an existing cached plan or one. And $ expr operators for join query in MongoDB “ test ” is database. Features enable authentication access to existing users must be run within a session, start instance! The existing collection is having schema validators run below command Reports statistics on the current database pass.! They are run by using a query, needs to determine a strategy!