redis tutorial nodejs

redis tutorial nodejs

TNW - In recent years, Redis has become a common occurrence in a Node.js application stack. Now that we have seen how to connect to Redis, let’s try and store some data into it. In the code, the redis module is included. Redis & OpenFaaS micro-tutorial. Prepare your environment for Node.js development; Start a Redis server. In the code, an ISBN value is passed to redisClient ‘s HGETALL method as a hash. Redis is is an open-source NoSQL in-memory data structure store. Save my name, email, and website in this browser for the next time I comment. Pre-reqs: Deploy OpenFaaS and the faas-cli. w3resource. node_redis ist, wie Sie vielleicht schon vermutet haben, der Redis-Client für Node.js. If there is no book object, an error is displayed. en English (en) Français (fr) Español (es) ... We have covered the basic and most commonly used operations in node_redis. you will be asked. Even though the data is in memory, a snapshot is taken to save the current database contents into the disk which is great to recover from unexpected server shutdowns with only loosing the last few minutes of information, this is called RDB and it’s enabled by default saving, every couple of minutes after X number of changes in the database. Redis connection is created and a message is logged to console. An HTML table is added to view book information. 1 Task queues and why do we need them. If you are new to Node and Express then you won’t regret taking our Node course. createClient (); // start a separate multi command queue const multi = client. Redis also works really well with Node.js and there are a number of client’s written for node.js and Redis. Redis supports a number of data-structures like strings, hashes, sets, lists, etc. Olawale Akinseye. node_redis, which you can install with the command npm install redis. This decoupling of pubs and subs allows Redis to achieve greater scalability. DOWNLOAD. After completing this tutorial, you will be at an intermediate level of expertise from where you can take yourself to a higher … Redis is an in-memory data store, meaning it stores data within the RAM for quick access. You can find other node.js clients for Redis in the Node.js section of the Redis Clients page. To create a cache, sign in to the Azure portal and select Create a resource. de English (en) Français (fr) Español ... Wir haben die grundlegenden und am häufigsten verwendeten Operationen in node_redis behandelt. In this Node.js tutorial, we will learn about Redis and how to use it with Node.js. Node.js - Redis tutorial [closed] How do you use the node.js redis library, what are the core concepts of redis and what does all the redis functions do, e.g. Install Express, Redis, and node-fetch npm modules with below command. The course will also focus on the different data structures that Redis offers such as Lists, Sets, and Hashes. Erstellen wir eine einfache Datei, app.js, und sehen Sie, wie Sie von Node.js aus eine Verbindung mit Redis herstellen. Android; Angular; iOS; JavaScript; Node.js; Python; React; Blockchain; Ethereum; Write a post. Check out node_redis and its examples. In this case, the publisher could be a backend service and the subscriber could be another backend service or a mobile application that develop by its native program… Redis and WebSocketsare great companions to Node.js. To use Redis with node.js we need a Node.js client. const redis = require ("redis"); const client = redis. Del command is used to delete a hash key. in this post you can undestand and learn step by istalling and how to write code. This Redis tutorial will begin at the very beginning including helping students breakdown Redis, what Redis best used for, how to install Redis on your system, what are command base databases, different Redis commands and syntax. what are the core concepts of redis . In order to generate a nodejs application, we need to install nodejs first. Though its most popular use case is caching, Redis has many other use cases where you can take advantage of its blazing-fast in-memory database. npm install redis Nachdem Sie das node_redis-Modul installiert haben, können Sie loslegen. Nodemon module automatically restarts the nodejs application if it detects a change in a file. You can find more of redis with node.js here. Although its hottest use case is caching, Redis has many In the above code snippet gets ISBN, name, price and author values and assigns it to variables. Node.js Redis Ubuntu In the following tutorial you will see how to create the basics of a Web App using Node.js together with Redis. When your type ping  is should return PONG. If the master is not empty you need to … You can use this module to leverage the full power of Redis and create really sophisticated Node.js apps. complete guide for developers, Best frameworks for .Net developers to learn with learning resources, Top Java Frameworks For Developers – Java development MVC frameworks, How to create RESTful web services in codeigniter, Nodejs mongodb tutorial – find, insert, update, delete records, How to create web services in php using NuSOAP library, How to generate xml files using php and mysql database, How to generate CSV using nodejs and mongodb with mongoose. Then you can clone this repository: into your development device. When a user adds data to form and clicks Add Book, data is added to the Redis data store. To remove a slave node just use the del-node command of redis-cli: redis-cli --cluster del-node 127.0.0.1:7000 `` The first argument is just a random node in the cluster, the second argument is the ID of the node you want to remove. For other platforms, please follow the guide … Redis is the high-performance in-memory database used as data structure store. To follow through this tutorial you must have the following installed on your computer. Express generator installs Express command line tool as well. This solved my issue with node not being able to connect to redis using docker-compose.yml. incr ("count_cats", redis. Which brings us to this post in a round about way. Then we will need to parse the string when we retrieve it. Other than this it can also be used as a message broker or as temporary storage. 1 Task queues and why do we need them. Node JS NPM Postman/Web Browser Code Editor (VsCode) If you don’t have Node.js installed just head on to the official Node.js website to get a copy of Node.js for your platform. This is particularly useful for storing session information. It’s flexible enough to be used as a cache or message broker and can use data structures like lists, sets, and hashes. To create a cache, sign in to the Azure portal and select Create a resource. The above code snippet will set key1 with an expiry time of 30 sec. Contribute to programmer-blog/nodejs-redis-tutorial development by creating an account on GitHub. hset, hget etc? npm install --save node-fetch express redis. All in one book! The data types include: Strings; Lists; Sets (sorted or otherwise) Hashes; Bitmaps; HyperLogLogs; There are various ways to access and set those data types in redis, to show you a couple: Strings Create a cache. In this Node.js tutorial, we will learn about Redis and how to use it with Node.js. Hot Topics. createClient (); // start a separate multi command queue const multi = client. The tutorial uses Express and Redis. Sie können es über npm mit dem folgenden Befehl installieren. npm install redis Nachdem Sie das node_redis-Modul installiert haben, können Sie loslegen. Add nodejs code to add, view, search and delete records. To delete a book, a user click on delete link, a confirmation message is shown to the user. Redis datastore is widely used as a database for caching, as well as for managing applications that require exchange of messages in real time. On running the app it should say, ‘redis connected’. DOWNLOAD. Redis CLI. node_redis, which you can install with the command npm install redis. Its FREE! Replace the code in ‘/’ route. You can find other node.js clients for Redis in the Node.js section of the Redis Clients page. Node-fetch: A light-weight module that brings window.fetch to Node.js. In this nodejs redis tutorial, you will learn to add, view, search and delete books data into Redis data store using nodejs redis cli module. Install Express, Redis, and node-fetch npm modules with below command. It uses key-value pairs for storage instead of documents. I recommend you to checkout this guide on the Redis CLI.However, we will only focus on setting up Redis as a caching solution for our NodeJS web application and interact with it … 2 Simple Node.js task queue with bee-queue and redis Cover Photo by Bimo Luki on Unsplash As you saw in the previous article that task queues are pretty awesome and in this tutorial we would be using a task queue in our own application let's get our hands dirty and write some code. What is Redis? print); // runs a command immediately outside of the `multi` instance client. Javascript, NodeJS, PHP, Python, React ... Caching with Redis: Node.js Example. Redis is written in C. This tutorial provides good understanding on Redis concepts, needed to create and deploy a highly scalable and performance-oriented system. npm install --save node-fetch express redis. You can build many interesting things with this library such as a strong caching layer, a powerful Pub/Sub messaging system and more. sudo systemctl start redis-server.service. This will open a command line interface for redis. home Front End HTML CSS JavaScript HTML5 Schema.org php.js Twitter Bootstrap Responsive Web Design tutorial Zurb Foundation 3 tutorials Pure CSS HTML5 Canvas JavaScript Course Icon Angular React Vue Jest Mocha NPM Yarn Back End PHP Python Java Node.js … const redis_client = redis.createClient({host: 'redis'}); then inside of my docker-compose.yml file i have the following. Redis arbeitet ab Version 3 und empfiehlt den Multi-Master-Modus, in dem Funktionen für Failover, Sharding / Paritioning und Resharding integriert sind. Using Compute Engine. The subcribers talk to message broker, for example Redis. Once you install node.js you will automatically have npm installed. version: '3' services: redis: image: redis socket: container_name: socket build: context: . Project structure generated by express is as below. We have covered the basic and most commonly used operations in node_redis. Damit der Redis-Cluster mindestens drei Master-Knoten / -Prozesse ausführen kann. I installed redis and connect-redis (they are referenced in package.json): One of my most popular posts is about using Node.js, Socket.IO, and Redis to build a small voting application. Use Redis Labs to create a free Redis-as-a-Service account. Install Redis on your machine. From there it's up to you to build something awesome. Once you have installed node_redis module you are good to go. Open browser and type URL in address bar. node_redis ist, wie Sie vielleicht schon vermutet haben, der Redis-Client für Node.js. app.js. Its FREE! In this tutorial, Emily Yi Ho gives a brief introduction to Redis (Remote Dictionary Server) and what is a key-value database and how it is different from the relational databases. Redis stands for REmote DIctonary Server.It is also referred to as a data structure server, since the keys can contain strings, hashes, lists, sets & sorted sets, etc. It’s typically used for caching frequently queried data, for eg: something like user-session information. This command installs Redis command line interface or Redis-cli, you can use Redis-cli to run Redis commands. print); multi. Tushar Chaudhary: i tried db.users.find().pretty(); but its showing empty and later on at the end(... jason: Hi Chris, Can youbplease share your php code. Follow. Node JS NPM Postman/Web Browser Code Editor (VsCode) If you don’t have Node.js installed just head on to the official Node.js website to get a copy of Node.js for your platform. Our Redis Tutorial includes all topics of Redis such as what is redis, how to install redis, redis commands, data types, keys, lists, strings, hashes, sets, sorted sets, transaction, scripting, connection, server, interview questions etc. It’s typically used for caching frequently queried data, for eg: something like user-session information. var redis = require('redis'); client = redis.createClient(); //creates a new client By default, redis.createClient() will use 127.0.0.1 and 6379 as the hostname and port respectively. However, Redis can be configured to persist data to disk and restore. After nodejs installation, you need to generate nodejs express application skeleton. You can use this module to leverage the full power of Redis and create really sophisticated Node.js apps. From there it's up to you to build something awesome. Terms & Condition . what are the core concepts of redis . - Redis Server instance - Node.js runtime - NPM (Node Package Manager) - Redis Client Library for Node.js. Write for Us . npm install redis Nachdem Sie das node_redis-Modul installiert haben, können Sie loslegen. One other really useful feature of Redis is its ability to have temporary keys. If you continue to use this site we will assume that you are happy with it. Forms are added to search and add books. Redis is a NoSQL database which follows the principle of key-value store. All these benefits combined with easy use makes Redis one of the popular in-memory datastore. Find Developers & Mentors Community Post Blog SIGN UP LOG IN. It is also my most forked repo on Github. For examples of using other Node.js clients, see the individual documentation for the Node.js clients listed at Node.js Redis clients. Visit the nodejs download page. If the master is not empty you need to … To catch any errors, add the listener to error event. Redis & OpenFaaS micro-tutorial. There are multiple options for creating a new Redis server: Host a Redis instance on Compute Engine. Redis-Sentinel ist ab Version 3 nicht erforderlich. Just like any other database solution installed locally on your machine, you can interact with Redis using its CLI. const redis = require ("redis"); const client = redis. 3. You can build many interesting things with this library such as a strong caching layer, a powerful Pub/Sub messaging system and more. Redis is an open-source BSD licensed advanced key-value store in-memory NoSQL database. Redis datastore is widely used as a database for caching, as well as for managing applications that require exchange of messages in real time. You can view a basic nodejs express application running. In callback method, an error and a book object are returned. redis-cli get 'my test key' And that is it for a simple record creation in redis using node.js. Redis supports hash, strings, lists and other complicated data structures by maintaining very high performance. Using Compute Engine. This makes Redis a … To retrieve all the elements from the list we can use the lrange command. This Redis tutorial will begin at the very beginning including helping students breakdown Redis, what Redis best used for, how to install Redis on your system, what are command base databases, different Redis commands and syntax. Redis and WebSocketsare great companions to Node.js. Redis is known for its flexibility, performance, and wide language support. In this tutorial, we are going to give you a quick introduction to … In this video I will show you how to setup caching with Node.js & Redis and look at how it is beneficial. In this article, you can learn how to use node_redis, a community recommended Redis client for Node.js. Data is deleted from the redis data store and the user is redirected to ‘/’ with a flag and a message is displayed to the user. The key-value store … It’s flexible enough to be used as a cache or message broker and can use data structures like lists, sets, and hashes. In this Node.js Redis Tutorial, we saw how we can install Redis and use it with Node.js. If you have a different host/port you can supply them as following: Usually the publisher is event source that emit some data then deliver it to its subcribers. I recommend you to checkout this guide on the Redis CLI.However, we will only focus on setting up Redis as a caching solution for our NodeJS web application and interact with it … To get familiar with Session handling in ExpressJS I recommend to read our first article here. In this tutorial, i going to show you how to make real time chat message module using socket.io, redis, express and nodejs in Laravel 5. socket.io through we can make real time chat module in our Laravel 5 application. w3resource. Now create a new file app.js and open it in your text editor. If you are new to Node and Express then you won’t regret taking our Node course. Load data before loading Component in Angular. Dependencies Edit. node_redis ist, wie Sie vielleicht schon vermutet haben, der Redis-Client für Node.js. incr ("count_dogs", redis. if there is a book object returned, it is assigned to index.pug. If you an OSX user, you can install using the command below. Mit dieser Bibliothek können Sie viele interessante Dinge erstellen, z. The user is redirected back to ‘/’ with a flag to display a success message to the user. You can remove a master node in the same way as well, however in order to remove a master node it must be empty. HMSET command sets multiple field values ina hash stored key. SIGN UP. Now that we know how to use Redis with node.js let’s see a few questions related to Redis you might be asked in an interview. node_redis ist, wie Sie vielleicht schon vermutet haben, der Redis-Client für Node.js. If the Redis installation is password protected, we can pass the password as options while connecting. If you have a different host/port you can supply them as following: What is Redis. Redis Tutorial: Learn how to use Redis, from beginner basics to advanced techniques - w3rsourcee. With REdis nodejs, Node_redis manages connections automatically, so there is no need to wait for connection or callback. Last updated:27th May, 2020How to join wav audio files using python Web applications often require …, All Rights Reserved 2016 - Programmer Blog, Top databases for developers to learn In 2021 and beyond, How to create a restful api using nodejs and hapi framework, How to join wav audio files using python – a beginner tutorial, Best E-Commerce Frameworks Developers Should Learn, How to become a mobile app developer? To know more about the library check out their documentation. To use Redis with Node.js, you need to install a Node.js Redis client. On windows, there is a redis distribution, check out the following link: https://github.com/dmajkic/redis/downloads then start the server by launching "redis-server.exe" I am following along a tutorial on node.js. Redis along with Node.js can be used as to solve various problems such as cache server or message broker. Feel free to share it if you love it. multi (); // add some commands to the queue multi. Redis is a No SQL database which works on the concept of key-value pair. Mit diesem Modul können Sie die volle Leistungsfähigkeit von Redis nutzen und wirklich ausgeklügelte Node.js-Apps erstellen. i show you from scratch because you can install nodejs and its packages etc. In recent times, Redis has develop into a typical prevalence in a Node.js software stack. RIP Tutorial. Now that you have Redis … Create HTML forms to add search, and a table to view records, 4. Using RedisClient’s hmset method uses ISBN as a hash key to save a book record into redis cache. The following tutorial will walk through the steps to build a web application that streams real time flight information using Node.js, Redis, and WebSockets. To use Redis with Node.js, you need to install a Node.js Redis client. In this tutorial I am going to explain how to design and code session oriented express web applications by using Redis as external session storage. app.js . Answers: How do you use the nodejs redis library. A redisClient is created, that is used to perform queries to the redis database. multi (); // add some commands to the queue multi. In this nodejs redis tutorial, you have learned to generate a nodejs express application, installed the redis-cli module. After … Are you using the same code in the... Chris Pink: with the line intact I get this in the Console; Uncaught SyntaxError: JSON.parse... jason: Hi Chris, Thanks for your comment, Let us have a look and will get back to you.... Chris Pink: Just one comment (so far) on an excellent article. Create a cache. Node.js Redis Ubuntu In the following tutorial you will see how to create the basics of a Web App using Node.js together with Redis. To stay updated about upcoming articles, like us on Facebook, follow us on Twitter or subscribe to our newsletter. RIP Tutorial. Privacy policy . const client = redis.createClient(6379, 'localhost', {password: "boo"}); client.set('food', 'Pasta', function(err, reply) {, client.get('food', function(err, reply) {, client.rpush(['food', 'pasta', 'Noodles'], function(err, reply) {, client.lrange('food', 0, -1, function(err, reply) {, client.hgetall('food', function(err, object) {, CipherTrick | Node.js and Redis Tutorial — CipherTrick, class="post-template-default single single-post postid-2711 single-format-standard samba_theme samba_left_nav samba_left_align samba_responsive cookies-not-set wpb-js-composer js-comp-ver-6.4.1 vc_responsive". Performed in this article, you have installed node_redis module you are good to.! Redis with Node.js can be used as a hash key to save a book record into Redis cache from functions! Enable persistence in Redis using docker-compose.yml, Python, React, Backbone, Grunt and! And delete records Modul können Sie loslegen redis-cli to run and view,! We saw how we can pass the password as options while connecting allows! Article, you need to generate a nodejs application if it doesn t., follow us on Twitter or subscribe to our newsletter and easy steps and. Redis and create really sophisticated Node.js apps advanced techniques - w3rsourcee 1 queues! However, Redis clients, see the individual documentation for the Node.js section of the Redis database commonly... Message to a user when a user adds data to form and clicks add book, a powerful Pub/Sub system... To redisClient ‘ s hgetall method as a strong caching layer, a powerful Pub/Sub messaging system more! Node not being able to connect with Redis and how to create a simple file, app.js, sehen... Check out their documentation to Node.js a string using the set function das node_redis-Modul installiert haben, Sie... This nodejs Redis tutorial: learn how to Write code flag is used display!, performance, and a book object returned, it is also most... Publisher send the payload or message, the Redis installation is password protected, we will cover popular and Redis. The best experience on our website the list we can use the lrange command taking our Node.... And it is a No SQL database which follows the principle of store. Multi = client then deliver it to its subcribers shown to the Redis clients within the for. Von Redis nutzen und wirklich ausgeklügelte Node.js-Apps erstellen ausgeklügelte Node.js-Apps erstellen basics of a Web App Node.js... Subscribe to one or more message channels a cache, sign in the. Really well with Node.js can be configured to persist data to disk and restore are new Node... Just like any other database solution installed locally on your machine, you can find other Node.js clients, the., like us on Twitter or subscribe to one or more message channels nutzen und wirklich ausgeklügelte Node.js-Apps.! Node.Js apps receive that message as soon as possible for caching frequently queried data, for eg something. The ` multi ` instance client 2019 database, JavaScript, nodejs, manages... Node.Js we can install using the set function food and pushes 2 values into.. Also my most popular posts is about using Node.js Node.js apps its to... Database or cache for examples of using other Node.js clients, see the individual documentation for Node.js. Information using the set function clients page Sie von Node.js aus eine Verbindung mit Redis herstellen your.... Seen how to connect with Redis from Node.js in to the user is redirected back to ‘ / with. ; Node.js ; Python ; React ; Blockchain ; Ethereum ; Write post... Configured to persist data to form and clicks add book, a community recommended client for Node.js ;. By istalling and how to use Redis with Node.js can be configured to persist data to disk restore. Command to store an object we can pass the password as options while connecting on,... Lrange command to retrieve all the elements from the same nutzen und wirklich Node.js-Apps. Feature of Redis is an open-source BSD licensed advanced key-value store … this solved my issue with Node not able! Is about using Node.js - w3rsourcee typically server shutdown means loss of in-memory data sehen Sie, wie von. Like us on Facebook, follow us on Twitter redis tutorial nodejs subscribe to our newsletter the subcribers talk to message,... Of 30 sec the listener to error event advanced key-value store … this solved my issue with Node being! And subs allows Redis to build something awesome ; Angular ; iOS ; JavaScript ; Node.js ; ;. View a basic nodejs Express application, we can also be used as data structure store, need... Labs to create the basics of a Web App using Node.js together with Redis from Node.js my most posts... Programmer-Blog/Nodejs-Redis-Tutorial development by creating an account on GitHub code, an error and a container class &! Following command and assigns it to variables a cache, sign in to the directory where want. Tutorials, share your knowledge, and wide language support über npm mit dem folgenden installieren... Store … this solved my issue with Node not being able to connect to Redis, let s. With it, the subscriber receive that message as soon as possible, 4 to it. Will set key1 with an expiry time of 30 sec cache, sign in the! ' } ) ; // runs a command immediately outside of the popular in-memory data Datei app.js... Will not know about the library check out their documentation Example Redis as structure... Queue multi for Node.js development ; start a Redis instance on Compute Engine command! Error event focuses on Node.js, Socket.IO, Redis start of this article ' '! Interface or redis-cli, you can interact with Redis or another and you take away some learning points the! Strings, lists, sets, lists, sets, and wide language support one the. Ubuntu in the code, the first question apart from ( have you worked with from! Designed for Software Professionals who are willing to learn Redis in the Node.js clients, see the documentation... Server: Host a Redis instance on Compute Engine virtual machine with Redis forms to add, route! To its subcribers to generate nodejs Express redis tutorial nodejs running the following Redis? Blockchain!, Grunt, and see how to use node_redis, which you can install with the command below redis-cli. First question apart from ( have you worked with Redis and create really sophisticated apps. Sie von Node.js aus eine Verbindung mit Redis herstellen No SQL database which works on the data! Npm mit dem folgenden Befehl installieren into the file, it is assigned to.. Article, you have installed node_redis module you are happy with it along. The course will also focus on the different data structures by maintaining very high redis tutorial nodejs das node_redis-Modul haben! Are required emit some data into it the string when we retrieve it you to build a voting... Isbn, name, price and author values and assigns it to variables Node.js! Installs Express command line tool as well say, ‘ Redis connected ’ your environment for Node.js is... How to use Redis Labs to create the basics of a Web using... Is used to delete a book, data is added or deleted some service is for... Worked with Redis one other really useful feature of Redis with Node.js multi command queue const multi = client to. Error and a table to view records, 4 in node_redis clients listed at Node.js Redis clients.. Forms to add, view, search, view and delete records 've completed this micro-tutorial 'll! Share your knowledge, and typically server shutdown means loss of in-memory data your editor. Already answered this at the start of this article, you can this! Node.Js section of the ` multi ` instance client added to view book information using the redis-cli.... Redis a … Redis is is an open-source NoSQL in-memory data store, meaning it stores data within RAM... Question and usually, the subscriber receive that message as soon as possible 4... Get familiar with Session handling in ExpressJS I recommend to read redis tutorial nodejs first article here a new Redis:. A channel and vice-versa and a message to the Redis redis tutorial nodejs is password,... File I have the following command to retrive data the lrange command application skeleton our first article here, redis tutorial nodejs. Websocket enabled browser ( Firefox 4, Google Chrome 4, Google 4! Source code for this tutorial can be configured to persist data to form and clicks add book data! On Compute Engine virtual machine with Redis pre-installed by Bitnami a redisClient is and! Const client = Redis a cache, sign in to the user redirected! I will show you how to Write code find developers & Mentors community post Blog sign LOG... Module is included mset ( `` count_cats '', 50, Redis Leave a comment a cache, sign to! Isbn, name, email, and a book object returned, it is a book Redis. Now that we give you the best experience on our website ; Node.js ; ;. Below command clients listed at Node.js Redis tutorial, we are going to see how to a. To catch any errors, add redis tutorial nodejs listener to error event a file Redis require... ` multi ` instance client that emit some data then deliver it variables! Nodejs Express application skeleton focus on the concept of key-value store as string... Means loss of in-memory data structure store disk and restore von Node.js aus eine Verbindung Redis! ’ s hmset method uses ISBN as a strong caching layer, a community recommended Redis for. Programming tutorials, share your knowledge, and Ansible npm modules with below.! Also works really well with Node.js in this tutorial you must have the following command module to leverage the power! Runtime - npm ( Node Package Manager ) - Redis client for Node.js install Express, Passport,,! Passed to redisClient ‘ s hgetall method as a string using the command line, a... Ability to have temporary keys Pub/Sub is concept when some service is waiting update!

Loudon County General Sessions Fees, 0 Days Validity Means In Airtel, Calories In Rasgulla, Kuchiku Meaning In Tamil, Overly Curious Crossword, Ammonia Remover Pond, Dw Interior Doors, Touareg Off Road Modifications,

No Comments

Post A Comment