LinkedIn skill assessment answers and questions — MongoDB
“MongoDB has revolutionized the way developers store and manage data, offering unprecedented flexibility and scalability. في هذا الدليل الشامل, we’re thrilled to present a series of مهارة تقيم الأسئلة و الإجابات specifically tailored for MongoDB المستخدمين.
Whether you’re a developer looking to expand your capabilities or a data scientist aiming to understand the inner workings of this cutting-edge technology, this resource is designed to help you become a master of MongoDB and its applications. Join us as we explore the fundamentals of MongoDB, query optimization, indexing strategies, and other critical aspects of working with this powerful database system.”
Q1. Which command adds members to the replica set from MongoDB shell?
-
rs.add("<hostname>")
-
replicaSetAdd("<hostname>")
-
rs.insert("<hostname>")
-
replica.add("<hostname>")
Which MongoDB shell command should you use to back up a database?
Q2.- restore
- backup
- mongobackup
- mongodump
Which shell query displays all citizens with an age greater than or equal to 21?
Q3.-
db.citizens.select('WHERE age >= 21')
-
db.citizens.where('age >= 21')
-
db.citizens.find('WHERE age >= 21')
-
db.citizens.find({age: {$gte: 21}})
What does a MongoDB collection consist of?
Q4.- البيانات
- توسيع Office و Microsoft Teams باستخدام Power Platform وتطبيقات وخدمات الجهات الخارجية
- مجالات
- صفوف
Given an ObjectId in _id
, how do you get the time it was created?
Q5. -
getDateTime(_id)
-
_id.createDate()
-
_id.getTimestamp()
-
_id.getDateTime()
Given a cursor named myCursor, which command returns a boolean value?
Q6.-
myCursor.hasNext()
-
myCursor.sort()
-
myCursor.next()
-
myCursor.find()
Which command returns a specific document in the user’s collection?
Q7.-
db.users.find({_id: 1})
-
db.users.seek({_id: 1})
-
db.users.query({_id: 1})
-
db.query.users({_id: 1})
To import a JSON array into Mongo, what flags are needed with MongoDBimport?
Q8.-
--type jsonArray
-
--json
-
--type json
-
--jsonArray
Choose the shell command that connects to a MongoDB database.
Q9.- mongo
- mongod
- mongoconnect
- dbconnect
In the MongoDB shell, how can you tell if an index was used with a query?
Q10.-
db.customers.find({lastName: 'smith'}).explain()
-
db.customers.find({lastName: 'smith'}).perf()
-
db.customers.find({lastName: 'smith'}).plan()
-
db.customers.find({lastName: 'smith'}).usedIndex()
Suppose your aggregation pipeline terminated with an exception referring to exceeded memory limit. What is the best way to resolve the issue?
سوف تحتاج إلى تحقيق ما لا يقل عن.- Set useMemory to twice amount indicated in exception.
- Switch a 64 bit instance of MongoDB.
- Increase the memory of the MongoDB server.
- Set allowDiskUse to true.
What is the recommended way to delete a user?
س 12.-
db.deleteUser("user")
-
db.removeUser("user") DEPRECATED
-
db.remove("user")
-
db.dropUser("user")
What the primary database in a replica set fails, when does failover begin?
Q13.- once the primary has been down for 10 الدقائق
- once the primary reboots
- فورا
- after the administrator reboots the primary
What is the correct option to set up Kerberos when starting MongoDBd?
س 14.-
--setParameter authenticationMechanisms=GSSAPI
-
--setAuthentication=GSSAPI
-
--setParam auth=K
-
--setAuth method=Kerberos
What is the purpose of an arbiter in a replica set?
س 15.- It monitors replica set and sends email in case of failure
- It casts the tie-breaking vote in an election.
- It holds a backup copy of the database.
- It reboots the failed server.
You want to know how many types of items you have in each category. Which query does this?
س 16.-
db.product.group({_id: "$category", count: {$sum:1}})
-
db.product.aggregate($sum: {_id: "$category", count: {$group:1}})
-
db.product.aggregate($group: {_id: "$category", count: {$sum:1}})
-
db.product.aggregate($count: {_id: "$category", count: {$group:1}})
To restrict the number of records coming back from a query, which command should you use?
Q17.- يأخذ
- حد
- max
- تخطى
You have a collection named restaurants with the geographical information stored in the location property, how do you create a geospatial index on it?
س 18.-
db.restaurants.createIndex({location: "2dsphere"})
-
db.restaurants.geospatial({location: "2dsphere"})
-
db.restaurants.createIndex("2dsphere":"location")
-
db.restaurants.createIndex({geospatial: "location"})
How do you find documents with a matching item in an embedded array?
Q19.-
db.customers.findmatch ({"jobs":"secretary"})
-
db.customers.find ({"jobs:secretary"})
-
db.customers.find ({"jobs":["secretary"]})
-
db.customers.find ({"jobs":"secretary"})
Which query bypasses the first 5 customers and returns the next 10?
س 20.-
db.customers.find({}, {skip: 5, limit: 10})
-
db.customers.find({}.page(5).take(10))
-
db.customers.find({}).skip(5).take(10)
-
db.customers.find({}).skip(5).limit(10)
How do you create a text index?
س 21.-
db.customers.createIndex({firstName, lastName})
-
db.customers.createTextIndex({firstName, lastName})
-
db.customers.createIndex({firstName: "text", lastName: "text"})
-
db.customers.createText({firstName: 1, lastName: 1})
Assuming you have customers collection with a firstName and lastName field, which is the correct MongoDB shell command to create an index on lastName, then firstName both ascending?
Q22.-
db.customers.createIndex("lastName, firstName, ASC")
-
db.customers.addIndex({lastName:"ASC", firstName: "ASC"})
-
db.customers.newIndex({lastName:1, firstName:1})
-
db.customers.createIndex({lastName:1, firstName: 1})
One of the documents in your collection has an _id based upon an older database design and you want to change it. You write an update command to find the document and replace the _id but the _id isn’t changed. How should you fix the issue?
Q23.- Set the replace option to true.
- Use the replaceOne() command instead.
- You can’t. Once set, the _id field cannot be changed.
- Use the updateOne() command instead.
A compound index allows you to _ ?
س 24.- Calculate interest quickly.
- Accomplish nothing, since compound indexes aren’t allowed in Mongo.
- Use more than one field per index.
- Combine fields in different collations.
Why are ad-hoc queries useful?
Q25.- They do not have to use the same operators.
- You do not need to structure the database to support them.
- They autogenerate reports.
- They run faster than indexed queries.
How often do the members of a replica set send heartbeats to each other?
س 26.- كل 2 الدقائق
- كل 5 ثواني
- كل 2 ثواني
- كل 10 ثواني
Which command returns all of the documents in the customers collection?
Q27.-
db.customers.all();
-
db.find().customers();
-
db.customers.find();
-
db.customers.show();
Given a cursor named myCursor, pointing to the customers collection, how to you get basic info about it?
س 28.-
myCursor.stats()
-
myCursor.dump()
-
myCursor.info()
-
myCursor.explain()
What is true about indexes?
س 29.- They speed up read access while slowing down writes.
- They secure the database from intruders.
- They speed up reads and writes.
- They speed up write access while slowing down reads.
What is the preferred format to store geospatial data in MongoDB?
Q30.- Latitude, longitude
- XML
- GeoJSON
- BSON
Which programming language is used to write MongoDB queries? (بديل: In the MongoDB shell, what programming language is used to make queries?)
س 31.- الثعبان
- جافا سكريبت
- SQL
- تايب سكريبت
You have two text fields in your document and you’d like both to be quickly searchable. What should you do?
Q32.- Create a text index on each field.
- MongoDB is not able to do this.
- Create a compound text index using both fields.
- Create a text index on one field and a single field index on the other.
To import a CSV file into MongoDB, which command should you issue?
على ___.- mongorestore
- mongoi
- upload
- mongoimport
In an MongoDB mapReduce command, the reduce function should _.
س 34.- access the database
- be called only when the key has a single value
- access the database only to perform read operations
- not access the data
On a newly created collection, which field will have an index?
تتم محاذاة كل طبقة وهذه كلها في نفس الوقت.- the name field
- the ObjectId field
- ال
_id
مجال - no field will have an index
You have a collection of thousands of students. You’d like to return the second set of 20 documents from the sorted collection. What is the proper order in which to apply the operations?
Q36.- حد, تخطى, نوع
- نوع, حد, تخطى
- حد, نوع, تخطى
- نوع, تخطى, حد
You would like the stats() command to return kilobytes instead of bytes. Which command should you run?
Q37.-
db.vehicle.stats(1024)
-
db.vehicle.stats("kilobytes")
-
db.vehicle.stats(true)
-
db.vehicle.stats("kb")
You want to modify an existing index. What is the best way to do this?
Q38.- استخدم ال
reIndex()
command to modify the index. - Delete the original index and create a new index.
- Call the
createIndex()
command with the update option. - استخدم ال
updateIndex()
يأمر.
You need to delete the index you created on the description field. Which command will accomplish this?
Q39.-
db.vehicle.dropIndex("description_text")
-
db.vehicle.dropIndex({"description":"text"})
-
db.vehicle.removeIndex({"description":"text"})
-
db.vehicle.removeIndex("description_text")
You would like to know how many different categories you have. Which query will best get the job done?
س 40.-
db.vehicle.distinct("category")
-
db.vehicle.unique("category")
-
db.vehicle.distinct("category").count()
-
db.vehicle.distinct("category").length
ملحوظة: عدد() works with find(…) but length works with distinct
From the MongoDB shell, how do you create a new document in the customers collection?
س 41.-
db.customers.add({name: "Bob"})
-
db.customers.save({name: "Bob"})
-
db.customers.create({name: "Bob"})
-
db.customers.new({name: "Bob"})
Which field is required of all MongoDB documents?
س 42.-
_id
-
_name
- ObjectId
- mongoDB is schema-less so no field is required
A MongoDB instance has at least what three files?
س 43.- البيانات, namespace, and journal
- namespace, مجلة, and log
- مجلة, البيانات, and database
- البيانات, log, and journal
You’d like a set of documents to be returned in last name, ascending order. Which query will accomplish this?
س 44.-
db.persons.find().sort({lastName: -1}}
-
db.persons.find().sort({lastName: 1}}
-
db.persons.find().sort({lastName: ascending}}
-
db.persons.find().sort({lastName: $asc}}
What is NOT a standard role in MongoDB?
س 45.- restore
- read/write
- dbadmin
- delete collections
Which MongoDB shell command deletes a single document?
س 46.-
db.customers.delete({_id: 1});
-
db.customers.drop({_id: 1});
-
db.drop.customers({_id: 1});
-
db.customers.remove({_id: 1});
ملحوظة: db.collection.remove() is deprecated in the new mongosh. Use db.collection.deleteOne() or db.collection.deleteMany().
المراجع: db.collection.remove() db.collection.delete()
Using the MongoDB shell, how do you remove the customer collection and its indexes?
Q47.-
db.customers.remove({}).indexes();
-
db.customers.remove({});
-
db.customers.drop();
-
db.customers.delete();
applications direct their read operations to which member of the replica set?
س 48. بشكل افتراضي,- primary
- arbiter
- secondary
- backup
You need to get the names of all the indexes on your current collection. What is the best way to accomplish this?
Q49.-
db.people.getName();
-
db.people.reIndex({names: 1});
-
db.people.getIndexKeys();
-
db.people.getIndexes();
ملحوظة: An alternative method in the mongosh shell is listIndexes()
You are going to do a series of updates to multiple records. You find setting the multi option of the update() command too tiresome. What should you do instead?
س 50.- Use the replaceMany() command instead
- Use the updateMulti() command instead
- Use the updateMany() command instead
- Set the global multi option to True
ملحوظة: An alternative method for db is .update()
To cleanly shut down MongoDB, what command should you use from the MongoDB shell?
س 51.- quit()
- exit()
- db.shutdownServer()
- db.shutdown()
Given a customer collection which includes fields for gender and city, which aggregate pipeline shows the number of female customers in each city? (بديل: How can you view the execution performance statistics for a query?)
Q52.-
db.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number: {$sum: 1}}}, {$sort :{number: -1}}])
-
db.members.find({$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number: {$sum: 1}}}.$sort ({number: -1})
-
db.members.find([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number: {$sum: 1}}}, {$sort :{number: -1}}])
-
db.members.aggregate([ {$match: {gender: "Female"}}, {$sort :{number: -1}}])
ملحوظة: If you want to analyze the performance of a query use .explain(“executionStats”)
When no parameters are passed to explain()
, what mode does it run in?
Q53. - wireTiger mode
- executionStats mode
- queryPlanner mode
- allPlansExecution mode
What is the correct query to find all of the people who have a home phone number defined?
س 54.-
db.person.find({exists: 'homePhone'});
-
db.person.exists({homePhone: true});
-
db.person.find({homePhone: {$exists: true}});
-
db.person.has('homePhone');
Which file in the MongoDB directly holds the MongoDB daemon?
Q55.- mongodb
- mongo-daemon
- daemon
- mongod
You have just secured your previously unsecured MongoDB server, but the server is still not requiring authentication. What is the best option?
س 56.- Restart the
mongod
عملية. - Issue the
secure()
يأمر. - Issue the
mongoimport
يأمر. - Issue the
authenticate()
يأمر.
What is the most accurate statement regarding MongoDB and ad hoc queries?
Q57.- MongoDB does not allow ad hoc queries; all queries require an index.
- Ad hoc queries are allowed only in the paid version.
- Ad hoc queries are allowed only through the ad hoc command.
- MongoDB allows ad hoc queries.
ملحوظة: You don’t need an index to perform ad hoc queries. Only pick one choice مرجع
In MongoDB, what does a projection do?
س 58.- allows you to do a calculation on the results
- allows you to run queries on the server
- allows you to select which fields should be in the return data
- allows you to format the results for a display
To remove a database and all of its records from MongoDB, what operator should you use?
س 59.-
dropDatabase()
-
removeAll()
-
clear()
-
deleteDatabase()
What option can be passed to start the MongoDB shell without connecting to a database?
س 60.-
-db=null
-
--shell-only
-
--free
-
-nodb
How can you improve the appearance of the output JSON that contains the _id
?
س 61. -
Use db.collection.set({$_id:pretty})
-
Use db.collection.find().pretty()
-
Use db.collection.format(numeric)
-
Use $_id = value
What happens to a Replica set oplog if it runs out of memory?
س 62.-
The oplog will be saved on one of the secondary servers.
-
The oplog is capped collection and can't run out of memory
-
The MongoDB instance will fail
-
The oplog will stop recording logging information
Argument:
لماذا ا “The oplog will be saved on one of the secondary servers.” is wrong:
MongoDB applies database operations on the primary and then records the operations on the primary’s oplog. The secondary members then copy and apply these operations in an asynchronous process. All replica set members contain a copy of the oplog, in the local.oplog.rs collection, which allows them to maintain the current state of the database.
Reasoning behind the right answer:
The oplog (operations log) is a special capped collection that keeps a rolling record of all operations that modify the data stored in your databases.
Unlike other capped collections, the oplog can grow past its configured size limit to avoid deleting the majority commit point.
MongoDB ships with a variety of files. Which file runs the MongoDB shell?
س 63.- mongo
- mongo-s
- shell
- mongo-shell
ملحوظة: mongosh is the new mongo shell, mongo is deprecated.
Starting in MongoDB v5.0, mongosh replaces mongo as the preferred shell.
[مرجع:] (https://www.mongodb.com/docs/mongodb-shell/)
How can you view the execution performance statistics for a query?
س 64.-
db.performance.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id:{city:"$city"}, number: {$sum: 1}}}, {$sort : {number: -1}}])
-
db.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number:{$sum:1}}}, {$sort: {number:-1}}]).explain("executionStats")
-
db.members.aggregate([ {$match: {gender: "Female"}}, {$group:{_id: {city: "$city"}, number: {$sum: 1}}}, {$sort: {number: -1}}]).explain()
-
db.members.aggregate([ {$match: {gender: """Female"""}}, {$group: {_id: {city: """$city"""}, number: {$sum:1}}}, {$sort: {number: -1}}]).number()
From the MongoDB shell, how do you execute a JavaScript file named list.js?
س 65.-
node 'list.js'
-
exec('list.js)
-
run('list.js)
-
load('list.js)
Which MongoDB shell query will sort the customer’s collection by name descending?
س 66.-
db.customers.sort({name: -1}.find({})
-
db.customers.sort({name: -1})
-
db.customers.find({}).sort({name: -1})
-
db.customers.find({}).sort({name: 1})
Suppose you are using the mongoimport
command to import personnel data and there is a unique index on the email field. What happens when there are duplicate emails in the import?
Q67. - The import command aborts without importing any records.
- The import command imports records upto but not including the record, and then aborts.
- The import command doesn’t import the bad document but does import the rest.
- The import command prompts you to correct the bad record.
ملحوظة: بشكل افتراضي, mongoimport continues an operation when it encounters duplicate key and document validation errors.
You have a collection with millions of documents. Each time you attempt to sort. MongoDB runs out of memory. What might help?
Q68.- Use the purge operator before the sort.
- Return the entire collection and sort on the client.
- Pass the –more-memory option.
- Create an index on the field you are sorting.
You need to be able to quickly find a word in a text field. What should you do?
Q69.- Create a text index on the field and do a $text Query.
- Create a single field index in descending order, and do a query for the word.
- Do a $text query.
- Create a $regex on the fields, and do a $regex query.
Argument: You need a text index in order to perform a $text query on a field. $text query uses the text index under the hood
المراجع: $text query Text index
Which field is always included in a projection unless specifically excluded?
س 70.- فهرس
- اسم
-
_id
- row number
After installing MongoDB on your machine, what must you do before launching Mongo?
س 71.- Create a user account.
- اشتراك مباشر.
- Create a data directory.
- Establish security credentials.
ملحوظة: The question in case is ambiguous. In the mongo docs, on the Windows Installation section, it clearly specifies the need for creating a data directory. ومع ذلك, that does not seem to be the case for Unix based systems. وبالتالي, that gives use the closest possible solution for a specific platform. If we extrapolate that to the question, that seems to be the most reasonable solution.
How does a –jsonArray file need to be structured?
التحكم في مخاطر سلامة العمليات.- as a properly formatted JSON array
- as YAML
- as plain text
- as a BSON object
From the MongoDB shell, how do you display all of a database’s memory usage?
Q73.-
db.size()
-
db.info()
-
db.memory()
-
db.stats()
How do you create a new MongoDB user?
التحكم في مخاطر سلامة العمليات.-
db.createUser({})
-
db.insert({user: 1})
-
db.customers.newUser({})
-
db.newUser({})
What is the internal data structure of a MongoDB document?
Q75.- JSON (JavaScript Object Notation)
- BSON (Binary JSON)
- ORM (object relational mode)
- MBF (MongoDB binary format)
MongoDB documentation JSON and BSON
Which projection shows only the FirstName and lastName fields of a document in the customers collection?
س 76.-
db.customers.find({}, {firstName: 1, lastName: 1})
-
db.customers.find({}, {_id:0, firstName: 1, lastName: 1})
-
db.customers.find({_id: 0, year: 1, maek: 1, model: 1})
-
db.customers.find({}).project({firstName: 1, lastName: 1})
Documents in mongodb are atomic at the ___ level
Q77.- قاعدة البيانات
- مجال
- لا
- وثيقة
What should the priority of a member be in order to prevent it from becoming the primary in replica set?
Q78.- 1
- باطل
- 0
- -1
You need to add an index to the large name collection in your production database. You do not want to have disruption of service for your users and you can’t afford to have a team to do the work during after hours. What should you do?
Q79.- Use the reIndex() command to add the index quickly.
- Use the createIndex() command with the option background = true.
- Use the createIndex() يأمر.
- Use the createIndex() command with the option parallel = true.
Concurrency Changed in version 4.2.
MongoDB uses an optimized build process that obtains and holds an exclusive lock on the specified collection at the start and end of the index build. All subsequent operations on the collection must wait until createIndex() releases the exclusive lock. createIndex() allows interleaving read and write operations during the majority of the index build.
For more information on the locking behavior of createIndex(), see Index Builds on Populated Collections.
When using aggregation $convert. which is not a parameter?
س 80.- input
- output
- إلى
- onError
All tag values in tag sets must be _.
س 81.- JSON
- integers
- سلاسل
- XML
When using the mongoimport command, how can you drop the database before importing?
س 82.- Use the -d option.
- Use the mongooverwrite command instead of mongoimport.
- Use the -drop option.
- Drop the database manually before importing.
Argument: There is no -d option in the docs (https://www.mongodb.com/docs/database-tools/mongoimport/#options.)
ملحوظة: Assuming you are asked to drop a collection instead while importing, the use the –drop option.
To import a CSV file into MongoDB, which command should you issue?
س 83.- upload
- mongorestore
- mongoi
- mongoimport
A critical record must be replicated to the two other servers in the set. Which query guarantees that it is inserted as desired?
س 84.-
db.inventory.insert({ prodid: "tab1122", qty : 10}, { writeConcern: { w: 2, wtimeout: 5000} })
-
db.inventory.insert({ prodid: "tab1122", qty : 10}, { writeConcern: { j: true} })
-
db.inventory.insert({ prodid: "tab1122", qty : 10}, { writeConcern: { w: 2, j:false, wtimeout: 5000} })
-
db.inventory.insert({ prodid: "tab1122", qty : 10}, { writeConcern: { w: 2, j:true, wtimeout: 5000} })
What is the name of the default file used to configure MongoDB?
Q85.- mongo.config
- mongod.conf
- config.sys
- .mdbconfig
After using the dropIndexes() command on your collection, one index remains.What can you do to drop the the remaining index?
س 86.- Use dropIndexes({الكل:1}) with the all parameter.
- The required_id index cannot be deleted.
- Call dropIndex({“هوية شخصية“:1}) to force its removal.
- Call dropIndex({“هوية شخصية“}) to force its removal.
To scale horizontally, what does MongoDB use?
Q87.- sharding
- replication
- partition
- backup
Your database collection holds web session information. One field, lastActivity, holds the timestamp of when the user was last active. You want to delete the user session after 30 minutes of inactivity. What is your best option?
Q88.- Create Javascript function called via an interval timeout to delete all records older than 30 الدقائق.
- Create a TTL index on the lastActivity field and set expireAfterSeconds to 1800.
- You have to create a stored procedure.
- Every time you create a new record for expired older records and delete them.
In the MongoDB shell, how can you tell if an index was used with a query?
Q89.-
db.customers.find({lastName: 'smith'}).explain()
-
db.customers.find({lastName: 'smith'}).perf()
-
db.customers.find({lastName: 'smith'}).plan()
-
db.customers.find({lastName: 'smith'}).usedIndex()
You need to be able to quickly find a word in a text field. What should you do?
س 90.- Create a text index on the field and do a $text Query.
- Create a single field index in descending order, and do a query for the word.
- Do a $text query.
- Create a $regex on the fields, and do a $regex query.
What is the name of the default file used to configure MongoDB?
س 91.- mongo.config
- mongod.conf
- config.sys
- .mdbconfig
You have a collection named restaurants with the geographical information stored in the location property, how do you create a geospatial index on it?
Q92.-
db.restaurants.createIndex({location: "2dsphere"})
-
db.restaurants.geospatial({location: "2dsphere"})
-
db.restaurants.createIndex("2dsphere":"location")
-
db.restaurants.createIndex({geospatial: "location"})
What happens to a Replica set oplog if it runs out of memory?
Q93.-
The oplog will be saved on one of the secondary servers.
-
The oplog is capped collection and can't run out of memory
-
The MongoDB instance will fail
-
The oplog will stop recording logging information
Using the MongoDB shell, how do you remove the customer collection and its indexes?
Q94.-
db.customers.remove({}).indexes();
-
db.customers.remove({});
-
db.customers.drop();
-
db.customers.delete();
What is the primary advantage of using MongoDB as a NoSQL database over traditional relational databases?
س 95.- Better support for complex joins
- Schema flexibility
- ACID compliance
- Fixed data structure
تتم محاذاة كل طبقة وهذه كلها في نفس الوقت : MongoDB’s primary advantage as a NoSQL database over traditional relational databases is its schema flexibility.
What is a Replica Set in MongoDB?
Q96.- A set of related database collections
- A group of MongoDB servers that maintain the same data set
- A type of database index in MongoDB
- A query language for MongoDB
Which command is used to create a new database in MongoDB?
Q97.-
createDatabase()
-
useDatabase()
-
db.createDatabase()
-
use
What is the default port number for MongoDB?
Q98.- 27017
- 3306
- 5432
- 8080
Which of the following is a BSON data type in MongoDB?
Q99.- Integer
- Float
- Date
- String
What is the purpose of an index in MongoDB?
س100.- To define the structure of a document
- To improve query performance
- To group related documents together
- To store binary data
Which operator is used for equality in MongoDB queries?
س101.-
$eq
-
$ne
-
$gt
-
$lt
What is the role of the mongod
process in MongoDB?
س102. - It is the MongoDB shell
- It is the primary daemon process for the MongoDB server
- It is responsible for data replication
- It is a tool for importing and exporting data
Which method is used to remove a document from a collection in MongoDB?
Q103.-
deleteOne()
-
removeOne()
-
drop()
-
remove()
What is a GridFS in MongoDB?
س104.- A distributed file system
- A system for managing database transactions
- A way to store large files in MongoDB
- A type of database index
Which aggregation stage in MongoDB is used to group documents by a specified expression and apply an accumulator expression to each group?
س105.-
$group
-
$match
-
$project
-
$sort
What is sharding in MongoDB?
س106.- The process of dividing a database into multiple collections
- The process of dividing a collection into multiple documents
- The process of dividing a database into multiple smaller databases
- The process of distributing data across multiple servers
Which operation is used to update a document in MongoDB?
Q107.-
update()
-
modify()
-
change()
-
set()
What is a TTL index in MongoDB?
س 108.- An index used for full-text search
- An index that automatically expires documents after a specified amount of time
- An index used for sorting documents in descending order
- An index used for geospatial queries
Which command is used to limit the number of documents returned in a MongoDB query?
س 109.-
limit()
-
count()
-
max()
-
skip()
What is a compound index in MongoDB?
س 110.- An index that combines multiple fields
- An index that spans multiple collections
- An index used for complex mathematical operations
- An index used for querying nested documents
Which operator is used to perform a logical OR operation in MongoDB queries?
س111.-
$or
-
$and
-
$not
-
$nor
What is a covered query in MongoDB?
س112.- A query that returns covered documents
- A query that covers multiple collections
- A query that uses a covered cursor
- A query that uses a covered index
Which method is used to create an index in MongoDB?
يتم تحديد حدود العملية من خلال تعيين المستويات العليا والسفلى لمجموعة من المعلمات.-
addIndex()
-
index()
-
createIndex()
-
makeIndex()
What is a compound shard key in MongoDB?
س114.- A key made up of multiple fields used for sharding
- A key used for encrypting data
- A key used for sorting documents in ascending order
- A key used for grouping documents
What is the purpose of the mongos
process in MongoDB?
س115. - It is a tool for monitoring server performance
- It is a tool for managing database backups
- It is a routing service for sharded clusters
- It is a tool for importing and exporting data
إضافة تعليق
يجب عليك تسجيل الدخول او التسجيل لتستطيع اضافه تعليق .