We are using scalar, as described in the docs:
According to this convention, the .NET/C# Driver sets the value of the _t field to the name of the class from which the document was serialized.
The example objects are below.
Note that “[BsonDiscriminator(RootClass = true)]” is required in our use case, even with MongoDB.Driver 2.17.1, to get the correct result with collection.OfType().AsQueryable().FirstOrDefault();

namespace Service.Core.Entities
{
 ...
[BsonDiscriminator(RootClass = true)]
public abstract class BaseEntity
{
   [BsonId]
   [BsonRepresentation(BsonType.ObjectId)]
   public string Id { get; set; }
}

[BsonIgnoreExtraElements]
public class MyEntityA: BaseEntity
{
   public List<MyTypeA> PropertyA { get; set; } = new List();
}

[BsonIgnoreExtraElements]
public class MyEntityB: BaseEntity
{
   public List<MyTypeB> PropertyB { get; set; } = new List();
}

public T Get<T>(string collectionName) where T : BaseEntity
{
   …
   var collection = _database.GetCollection(collectionName);
   returnValue = collection.OfType<T>().AsQueryable().FirstOrDefault();
}

Incidentally, MyEntityA is the first document listed in the collection when viewed with Compass.

In 2.17.1, the above code returns the correct documents.
However, with 3.0, Get<MyEntityB>(“myCollection”) produces a returnValue with an Id matching MyEntityA and PropertyB is null. Clearly, it matched the MyEntityA document instead.

Using the .Where method with 3.0 as shown in link, the below code produces returnValue = null for both MyEntityA and MyEntityB !

public T Get<T>(string collectionName) where T : BaseEntity
{
   …
   var collection = _database.GetCollection(collectionName);
   returnValue = collection.AsQueryable().Where(t => t.GetType() == typeof(T)).FirstOrDefault();
}