Database connectivity inside a node

I created a node which has two fields name and password and i want to save this details inside the mongo but i dont want to use the in built mongodb connection node.

There is no in built mongo node. The node configuration is stored on the flow file and the credentials should be stored in the credentials file if coded correctly.. The storage for these is pluggable but as far as I know there is not (yet) a mongo option.

@dceejay can i write mongo connectivity code inside .js file

If you want to, yes.