Skip to content

Releases: mongodb/mongo-csharp-analyzer

v1.3.0

05 Sep 19:18
7207b62
Compare
Choose a tag to compare

MongoDB .NET Analyzer 1.3.0 Release Notes

This is the general availability release for the 1.3.0 version of the analyzer.

The main new features in 1.3.0 include:

New analysis rules introduced: POCO to JSON

The new analysis rules allow to display the driver serialization result for a POCO in compiler time.
This can be used to validate correctness of BSON attributes setup and get a driver JSON representation shape.
For example:

public class Address
{
    [BsonElement("street")]
    public string StreetName { get; set; }

    [BsonIgnore]
    public string City { get; set; }
    
    public string Province { get; set; }

    [BsonElement("zip")]
    public string ZipCode { get; set; }
}

Will display the following JSON representation: { "street" : "Maplewood Lane", "Province" : "Lombardy", "zip" : "60601" }.
Notice that BsonElement and BsonIgnore attributes are accounted for.

Support for BSON serialization attributes

BSON serialization attributes like BsonElement, BsonIgnore, BsonIgnoreIfNull and other attributes are supported in POCO, LINQ and Builders analysis.

Additional main improvements in 1.3.0:

VS-93 introduces support for expressions with enums in tupples
VS-97 introduces better support for nullables

The full list of JIRA issues resolved in this release is available here.

v1.2.0

15 Feb 23:27
Compare
Choose a tag to compare

MongoDB .NET Analyzer 1.2.0 Release Notes

This is the general availability release for the 1.2.0 version of the analyzer.

The main new features in 1.2.0 include:

Builders for Atlas Search limited support

// Search definition (analyzer provides mql as information message)
var searchTitle = Builders<Movie>.Search.Wildcard(p => p.Title, "Green D*");

// MQL is displayed for 'searchTitle' variable
moviesCollection.Aggregate().Search(searchTitle)

Support for default LINQ3 provider in 2.19.0 and higher driver versions

Default LINQ provider version is set automatically to V2 in 2.18.0 and lower versions and to V3 in 2.19.0 and higher versions.
For more information see DefaultLinqVersion option in Analyzer configuration.

Main bug fixes in 1.2.0 include:

VS-79 LINQ expressions are not analyzed without "using MongoDB.Driver.Linq;"

The full list of JIRA issues resolved in this release is available here.

v1.1.0

02 Nov 20:19
Compare
Choose a tag to compare

MongoDB .NET Analyzer 1.1.0 Release Notes

This is the general availability release for the 1.1.0 version of the analyzer.

The main new features in 1.1.0 include:

Builders variables tracking and composition

var filterScore = Builders<Movie>.Filter.Gt(p => p.Score, 5);
var filterTitle = Builders<Movie>.Filter.Regex(p => p.Title, "Summer");
var filterGenre = Builders<Movie>.Filter.Eq(p => p.Genre, Genre.Comedy);
 
// MQL is dispalyed for each filter variable
var filterCombined = filterTitle | filterScore | filterGenre;

// MQL for the combined filter is displayed
moviesCollection.Find(filterCombined);

Fluent API support

// MQL is displayed for the Fluent API methods
_ = moviesCollection
   .Find(u => u.Producer.Contains("Nolan"))
   .SortBy(u => u.Score)
   .ThenBy(u => u.Title);

LINQ Query syntax support

// MQL is displayed for LINQ expressions using query syntax 
var queryable = from movie in moviesCollection
    group movie by movie.Genre into g
    select g;

Builders IndexKeys support

// IndexKeys builder is analyzed 
_ = Builders<User>.IndexKeys.Ascending(x => x.Age);
_ = Builders<Shape>.IndexKeys.Geo2D(u => u.Point);

Builders Projections support

// Projection builder is analyzed 
_ = Builders<User>.Projection.Include(u => u.Age);
_ = Builders<Person>.Projection.Expression(u => u.Address);

The full list of JIRA issues resolved in this release is available at:

https://jira.mongodb.org/issues/?jql=project%20%3D%20VS%20AND%20fixVersion%20%3D%201.1.0