Skip to content

Ability to select and exclude fields from the document #100

@IamSebastianDev

Description

@IamSebastianDev

Feature Request

Describe the feature you would like to see added:

Right now, Documents cannot be shaped by a find Options query. It might be useful to be able to exclude or select certain fields specifically, for example to enable not returning password field of a Document.

Example syntax:

type User = {
    email: string; 
    password: string;
}

const users = await db.collect<User>('users'); 
const result = await users.findOne({
    where: {
        email: Like('test')
    }, 
    exclude: ['password']
})

// result would log
// { _id: ObjectId, id: string, email: string }

Why do you believe this feature would be useful?

More flexibility is always a good thing.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions