.net - Mongodb c# 2.0 driver doesn't ignore extra elements -


i'm using 2.0 mongodb c# driver.
have 2 classes:

[bsonignoreextraelements] public class a{...}  [bsonignoreextraelements] public class b:a{...} 

this code:

public async task<list<a>> getlist(string x) {     var collection = db.getcollection<a>("mycollection");     var filter = builders<a>.filter.eq("fielda", x);     list<a> anslist = await collection.find(filter).tolistasync();      return anslist; } 

on computer works fine, reason on other computers function returns list<b> contains full objects saved in db. don't want expose fields users therefore must return list without class b's fields.


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -