Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion source/includes/code-examples/quick-reference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// Replace the placeholder with your connection URI
var client = new MongoClient("<Your connection URI>");
var db = PlanetDbContext.Create(client.GetDatabase("sample_planets"));
db.Database.EnsureCreated();
// end-create-instance

void FindOne()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
new DbContextOptionsBuilder<MyDbContext>().UseMongoDB(mongoClient, "<Database Name>");

var db = new MyDbContext(dbContextOptions.Options);
db.Database.EnsureCreated();

// Add a new customer and save it to the database
db.Customers.Add(new Customer() { name = "John Doe", Order = "1 Green Tea" });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
var dbContextOptions =
new DbContextOptionsBuilder<MyDbContext>().UseMongoDB(mongoClient, "<Database Name");

var db = new MyDbContext(dbContextOptions.Options);
db.Database.EnsureCreated();
var db = new MyDbContext(dbContextOptions.Options);
1 change: 0 additions & 1 deletion source/includes/quick-start/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
}
var client = new MongoClient(connectionString);
var db = MflixDbContext.Create(client.GetDatabase("sample_mflix"));
db.Database.EnsureCreated();

var movie = db.Movies.First(m => m.Title == "Back to the Future");
Console.WriteLine(movie.Plot);
Expand Down
8 changes: 8 additions & 0 deletions source/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ Version 8.1.0 Breaking Changes
creating the collection or database
implicitly.

.. note::

Calling the ``EnsureCreated()`` or ``EnsureCreatedAsync()`` method throws
an error if your application is running on a
:atlas:`shared cluster </reference/free-shared-limitations/>`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just making sure this should be "shared cluster" and not "sharded cluster" (assuming so, from the link)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's supposed to be "shared"

Applications running on free and shared clusters should not call these
methods.

If you don't want to ensure :wikipedia:`optimistic concurrency
<Optimistic_concurrency_control>` with transactions, you can
disable automatic transactions by setting ``Database.AutoTransactionBehavior =
Expand Down
Loading