How can we make password creation rule for Mongodb user? - mongodb

I wanted to create some predefined rules for password when the admin user create users in Mongodb. is that possible?

MongoDB does offer schema validation since version 3.2. See: https://docs.mongodb.com/manual/core/schema-validation/
I'm not sure what programming language you are using, but if you are using Node.js you might consider using Mongoose as the validation rules might be more flexible for your use cases. See: http://mongoosejs.com/docs/validation.html

Related

What is the convention for creating applications users in MongoDB?

I am trying to create a users model for my application sign in with Mongoose / MongoDB. Based on how I see it when I deploy to Atlas or Mlab, it auto generates a users collection but for the purpose of database authentication - like this user has read access, write access, admin, etc. What is the convention for creating application users? Do I also use the same users collection but add additional schema properties or do I make a different one altogether like app_users. Thanks!
Are you using the test or admin database? You should create a new database for your application. When you create a new database it will not come with any predefined collections or such, so you can start blank (which is what I assume you want?).
You don't need to explicitly create a new database. Just point your driver to a database name you want for your app. Or in the mongo CLI type use myAppDb and you can start adding collections there.
More details here https://docs.mongodb.com/manual/mongo/#working-with-the-mongo-shell

Does Laravel support MongoB by default or any NoSQL database?

My company runs a huge Lumen 5.1 project on MySQL. They want to add to it analytics, and they that part to use MongoDB
Is it possible to use MongoDB without any third party libraries? I one going to use
https://github.com/jenssegers/laravel-mongodb
But the tech lead thinks Laravel support MongoDB by default, I'm just asking this question to check whether that's true or not.
Edit:
If MongoDB isn't an option, does Laravel support any other NoSQL by default?
Laravel does not support MongoDB by default.
You would need to use one of several available third-party packages. I like moloquent because it maps mongo db collections to laravel models just like eloquent.
You can use Redis if you need a natively supported NoSQL db or could consider ElasticSearch (not supported natively) if you are going to store a lot of meta data and then analyse it. Tools like kibana and logstash might get very helpful.

default user mongodb with django_restframework_mongoengine?

I am using django_restframework_mongoengine in a project and I need to know if it exists, and how to use the default user of mongodb. As well as the user of django with its ORM, I have some possibility with an ODM?

LDAP for PostgreSQL

Requires upload user information from Active Directory.
I found on the Internet a few additions that provide this opportunity: multicorn and ldap_fdw.
The problem is that I can not figure out how to filter the result
For example multicorn allows you to specify the directory where to search (path) and the object of the search (objectClass). But this is not enough. It is necessary to restrict the people who are in a particular group.
How to do it?
Postgres uses LDAP only to check password. You must still create roles with proper Postgres options, heritage and grants.
To create roles dynamically from LDAP rather than creating them manually without password, you can use a tool like ldap2pg.
Using ldap_fdw or multicorn should not be useful for this. These extensions are meant to expose foreign data to APP, not to extend Postgres internals.
Cheers,

Can you have collection level permissions in MongoDB?

Can you have collection level permissions in MongoDB? Similar to table level permissions in a SQL database?
This is the only thing I could find on it. Looks like an old ticket.
https://jira.mongodb.org/browse/SERVER-1105
For anyone coming to this late (like I did), MongoDB now has support for collection-level authorization.
See: http://docs.mongodb.org/manual/core/collection-level-access-control/
Nope, not yet, MongoDB access control is currently only available at the database level. Depending on your requirements, it might be an option to implement a security model in application code that controls access down to the collection level.