exam questions

Exam DP-420 All Questions

View all questions & answers for the DP-420 exam

Exam DP-420 topic 1 question 36 discussion

Actual exam question from Microsoft's DP-420
Question #: 36
Topic #: 1
[All DP-420 Questions]

You have an Azure Cosmos DB for NoSQL account named account1.

You need to create a container named Container1 in account1 by using the Azure Cosmos DB .NET SDK. The solution must ensure that the items in Container1 never expire.

What should you set?

  • A. TimeToLivePropertyPath to null
  • B. TimeToLivePropertyPath to 0
  • C. DefaultTimeToLive to null
  • D. DefaultTimeToLive to –1
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
bcd_6
Highly Voted 1 year, 6 months ago
Selected Answer: C
Set to null will never expire. If set to -1 might override by the item's ttl
upvoted 7 times
xRiot007
1 year, 5 months ago
When creating a container de DefaultTimeToLive has to be set to -1 for items to never expire. Overrides are not specified in this question and even if they were, this prop cannot be null, because the SDK is expecting a non-nullable integer.
upvoted 2 times
xRiot007
1 year, 5 months ago
Correction - it can be null, but in that case TTL is turned off. To have items that never expire you must set it to -1.
upvoted 1 times
xRiot007
1 year, 5 months ago
More details here: https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.documentcollection.defaulttimetolive?view=azure-dotnet
upvoted 1 times
...
...
...
...
Blubb1860
Highly Voted 1 year, 5 months ago
Selected Answer: C
Set to null will never expire.
upvoted 5 times
...
Examdumps2023
Most Recent 11 months, 2 weeks ago
Selected Answer: D
To create a container named Container1 in account1 using the Azure Cosmos DB .NET SDK and ensure that the items in Container1 never expire, you should configure the DefaultTimeToLive property. Setting the DefaultTimeToLive to -1 ensures that items never expire.
upvoted 3 times
...
Bartus007
1 year, 2 months ago
ttl = -1 TTL is disabled. The item will never expire.
upvoted 1 times
...
[Removed]
1 year, 3 months ago
Selected Answer: D
Apologies, the correct choice is option C, setting DefaultTimeToLive to null. This ensures that items in Container1 will never expire. If you set DefaultTimeToLive to null (option C), the container items will never expire, regardless of any TTL set for individual items. Option D, setting DefaultTimeToLive to -1, is incorrect because it would prevent the container TTL from expiring, but if you set a TTL for individual items, those items would still expire based on their TTL value. For more details, please refer to Example 1 and Example 2 in the following link: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/time-to-live
upvoted 1 times
...
[Removed]
1 year, 3 months ago
Selected Answer: C
Apologies, the correct choice is option C, setting DefaultTimeToLive to null. This ensures that items in Container1 will never expire. If you set DefaultTimeToLive to null (option C), the container items will never expire, regardless of any TTL set for individual items. Option B, setting DefaultTimeToLive to -1, is incorrect because it would prevent the container TTL from expiring, but if you set a TTL for individual items, those items would still expire based on their TTL value. For more details, please refer to Example 1 and Example 2 in the following link: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/time-to-live
upvoted 2 times
...
[Removed]
1 year, 3 months ago
Selected Answer: D
TimeToLivePropertyPath specifies a path within the JSON document that indicates the expiration time. Setting it to null disables time-to-live (TTL) for individual items, while setting it to 0 would immediately expire the items. Both options are not suitable for ensuring items never expire. DefaultTimeToLive sets the default expiration time for all items in the container. Setting it to -1 signifies that the items will never expire. This is the desired behavior for this scenario.
upvoted 1 times
[Removed]
1 year, 3 months ago
Apologies, the correct choice is option C, setting DefaultTimeToLive to null. This ensures that items in Container1 will never expire. If you set DefaultTimeToLive to null (option C), the container items will never expire, regardless of any TTL set for individual items. Option D, setting DefaultTimeToLive to -1, is incorrect because it would prevent the container TTL from expiring, but if you set a TTL for individual items, those items would still expire based on their TTL value. For more details, please refer to Example 1 and Example 2 in the following link: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/time-to-live
upvoted 1 times
...
[Removed]
1 year, 3 months ago
Apologies, the correct choice is option C, setting DefaultTimeToLive to null. This ensures that items in Container1 will never expire. If you set DefaultTimeToLive to null (option C), the container items will never expire, regardless of any TTL set for individual items. Option B, setting DefaultTimeToLive to -1, is incorrect because it would prevent the container TTL from expiring, but if you set a TTL for individual items, those items would still expire based on their TTL value. For more details, please refer to Example 1 and Example 2 in the following link: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/time-to-live
upvoted 1 times
...
...
SwePha
1 year, 6 months ago
Selected Answer: D
// Never expire by default DefaultTimeToLive = -1
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...