Mongoose save is not a function. My contact schema works, it sends data to my db.
Mongoose save is not a function js, Mongoose and MongoDB you are using? Note that "latest" is not a version. Every tutorial i see, says Model. model as a var like in your previous comment and then exporting like module. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. save() function. pre, that overrides some of mongoose's methods, such as findByIDAndUpdate. If it is, encrypt it. myModel. I'm getting the following error: Uncaught TypeError: mongo Oct 24, 2021 · you are creating new instance for the model try this. Jun 29, 2021 · I just created a simple backend of Contact form Using Nodejs, Express and Mongoose. . I added the result of the console. Apr 14, 2012 · When i did model. save() in Mongoose + Nodejs. Somewhat confusing since we also have a separate document class. js:26:11) at _next (C:\code\project\node_modules\hooks-fixed\hooks. How to fix . 5+ seconds to complete, and if I user Model. You signed out in another tab or window. Hot Network Questions How do I vertically center the cells in specific columns Mar 1, 2013 · at THIS time, the last line in that file, which creates the Model (module. Oct 20, 2019 · I want to save some data in mongodb database. It's module. Reading the mongoose documentation, it looks like you need to call . My contact schema works, it sends data to my db. I have added a console. Feb 13, 2017 · The . While in . save is not a function so I believe it. I used Product. save(), remove then and wait for database to response, like below: Jan 28, 2016 · Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. save is not a function (in the createNew function) Before assigning the properties with the spread operator, the userModel object has a save function (as designed by mongoose), however after the assign the function cannot be accessed anymore. save() indeed is not a function. model'). create() from Mongoose doesn´t save the Documents in my Collection. TypeError: user. Ask Question . Nov 15, 2022 · . After user. Oct 17, 2020 · It seems you are fetching the document into memory and re-setting the hour field to 0, better you can run an update query into the database itself. 2 and I've been able to save data to the mongo Atlas database BUT I can not get the data down. But I got bellow error: How to solve TypeError: person. I do not know what a Contact is (that is part of your code not JS) but importantly one doesn’t just add or remove quotation marks to see what happens. Modified 3 years, 11 months ago. Unable to create collection via mongoose. Viewed 401 times 1 I have an schema and when I I am using mongoose to connect to an MongoLab database, I have separated my database model and stuff as a separate module form the rest of my code. I am using mongodb to make a mini twitter clone. Jul 25, 2020 · It's nothing wrong with mongo or mongoose, it's arrow function declaration. process. There is function keyword everywhere in examples. json, that want to keep using the latest version. Mongoose - trying to update an object in MongoDB, getting Apr 13, 2022 · If you want to use the save() method, you should use Mongoose instead of MongoDB. What am I missing? Also, here is the output of the `console. I do not know the content inside the save()-function, but I am guessing that they are saving the user in the database with the updated hashed password. May 12, 2019 · I'm setting up a backend server, and i want to do a put method in router. save() while using mongoose. save() doesn't work on mongoose. user. 1 MongoDB server v Oct 6, 2015 · See my EDIT. exec(); book. Why ". To use write concern with transactions, see Transactions and Write Concern. Apr 23, 2020 · The updatedProduct is a Mongoose Document (ProductDoc) returned from findProduct: import { Document } from 'mongoose'; export interface ProductDoc extends Document { id: string; title: string; description: string; price: number; } The updateAProduct service is called in a controller as follows: Dec 11, 2017 · I'm developing an app using Node. 33 because I tried it and it worked, but then I felt weird about just downgrading to fix a problem so I found the solution which allows you to keep version >= 3. export const updateSWAMRequest = async (req, res) => { // remember, cannot add fields that aren't in model. find() or Model. To make it work you can use a fix like : May 9, 2015 · However, this entire . Mongoose: 4. isModified is not a function at model. This is not to be confused with regular promises. This is a mongoose function that I have used before. Jul 26, 2022 · Mongoose save() is not a function. model('user', UserSchema) User should be the model name and remember to define const UserSchema = new Schema at the top to create a new model in MongoDB and Feb 24, 2019 · Mongoose: save() is not a function when using find() and atributing value to variable. Simply put, the Promises/A+ specification requires a then function to work much like how we're used to with promises. mongoose . find is not a function in mongoose. log INSIDE the save and result never gets logged. But Shop simply won't and I am pulling out my hair, not TypeError: this. update works and save never works and does not even fire callback. timestamps. You switched accounts on another tab or window. save to DB (use mongoose) is not a function. status(200). js. I am trying to create an new Model and then save Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers; Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand You signed in with another tab or window. fn (C:\code\project\node_modules\mongoose\lib\schema. save() Which results in newUser. exec we should define it via mockReturnThis():. set('test', 'teste'); measure. There are several ways to update a document in Mongoose, but save() is the most fully featured. save() will always be the same, // regardless of how, or how often, we observe it. 2" or less, save() operations that would result in the creation of a new collection are not allowed in a transaction. model('members', MemberSchema); module The solution which returns a promise (no callbacks): Use Document#populate // These two are same book. There is no use of Schema variable in your code. Provide details and share your research! But avoid …. log(user) , and it'll be undefined . Models don't have a static save() function, save() is an instance method and in Mongoose, an instance of a model is called a document. May 7, 2020 · When trying to post user data to database with mongoose, so the problem is like this: In order for user to get credits i'm charging him "money" with stripe library so when im trying to post data i Jul 23, 2021 · Either use the findOne() method which returns a single Mongoose document that has the save method or use findOneAndUpdate() for an atomic update. save is taking over ~1. findOne ({ firstName: 'franklin', lastName: 'roosevelt'}); user. mockReturnThis(); I needed the constructor to be called via new so i preferd to define a mock class in this way: For fcv "4. Aug 27, 2021 · i want to update password when call put function to update profile data exports. Sep 5, 2020 · Mongoose save() is not a function. Setting the upsert option to true is enough to guarantee that Mongoose will create a new document if one doesn't already exist. Jan 2, 2022 · I'm learning MongoDB and Mongoose, and I've watched instructors advise to use the save() function to save the changes made to the database. then({}); // Usage Apr 19, 2023 · Prerequisites I have written a descriptive issue title I have searched existing issues to ensure the bug has not already been reported Mongoose version 7. Jan 14, 2020 · @Dondaj nope, although it's narrowed the problem down to how the model is being exported. Hope it helps Jan 8, 2025 · The Mongoose save() function is used to persist data to a MongoDB database. Further, the return from the . tagModel. find() returns null after model. save() use one of the following options: Example 1 I have a problem with Mongoose and MongoDb It is very interesting that only Model. When you create an instance of a Mongoose model using new, calling save() makes Mongoose insert a new document. For cases when save() isn't flexible enough, Mongoose lets you create your own MongoDB updates with casting, middleware , and limited validation . Oct 3, 2015 · Please read this part of documentation from mongoose and try the following: var measure = new Cache({test:'teste'}); // or measure. create(createTagDto); return tag. js file is boilerplate. Model. 7 and it's now working. Here is my code: Model: var mongoose = req function isPromise (thenable) { return thenable instanceof Promise; } // The fulfillment value of the promise returned by user. export. I am trying to use the . Not sometimes but always. 5 MongoDB: 3. js Jan 8, 2022 · You signed in with another tab or window. module. somefunction is not a a function [Mongoose] 3. find and that returns a collection of elements with no . Besides that, you might want to change the find to a findOne, since find () will return an array of users. Mar 20, 2021 · Mongoose . Hot Network Questions Jun 8, 2016 · Here i defined what is the problem that why they did not find the insertMany. Share Improve this answer Sep 24, 2018 · Model. So the model does not exist at that point in time. save() , i get error: events. Ask Question Asked 6 years, 4 months ago. But through my terminal, I am being able to Jun 22, 2017 · TypeError: user. Mongoose . Dec 31, 2014 · Don't modify the private _doc object directly, assign the model instance's top-level properties so that Mongoose can track the changes and apply them when you call save. 4 added a method called insertMany. 5 Mongoose version: When the bug was occurring, i was using ^5. Other than . findById is not a function also the interface is extended from mongoose Document, the findById function is not recognized in the test. This function is faster than . import { Model } from 'mongoose'; import { InjectModel } from '@nestjs/mongoose'; import { Injectable } from You signed in with another tab or window. /user') May 30, 2018 · I'm fairly new to Mongoose and MongoDB itself and I'm trying to save a bunch of documents inserted via insertMany method but it is not saving the docs. Jun 1, 2020 · Mongoose's save() function is one way to save the changes you made to a document to the database. When I try using: Maybe it's a Hot Module Reloading issue, where Next is rerunning the code and thus redefining the model. On top require mongoose - Jan 19, 2023 · Mongoose queries do provide a then function. 13. findOne({email: email}) const senderData = await FriendModel. Your function helper. save function was always my main way of saving documents to db. This is a circular require problem. TypeError: User. var User = require('. 0 Model. Asking for help, clarification, or responding to other answers. I was using Product. last_used equal to it. js script. helperRes is a function but you are not invoking it when you set userRes. fn(). log() i write into the function ever outputs anything. The database never gets created and data do not get saved, and does not throw any errors. save() function doesn’t exist because you called . save(function Oct 26, 2020 · Make sure to check model hooks e. How to solve Dec 23, 2016 · I am also facing . My prefered method of checking if it connects is by using the code. Can someone explain why this is and how to get around it? What are the versions of Node. You need to do just like adding new fields to json object using . save is not a function [mongoose] 0. The quotes are defining myData as a string. post. find () should just return a query object and not the result. Mar 28, 2017 · mongoose. updateProfileUser = catchAsyncErrors(async (req, res) => { const userId = req. I have 2 Models: Contact and Shop. pre (C:\code\project\core\models\user. exports = User = mongoose. 1. save() is not a function error, but I have gone through most of the similar SO Questions and tried their respective answers but to vain. save() function throws me an error? 1. save method. findOne({email: sender}) console. save() function doesn't exist because you called . save() is not a function”(. However it just creates a record like the one below. That function is called helperRes. exports = mongoose. Aug 31, 2022 · I am following a nodejs and mongoose tutorial and the only way i can query the collection is via the . connection. However I'm getting an error: productToBeUpdated. save is not a function` - what is wrong? 2. log(newUser) await newUser. generally, we create an instance to save a document in DB like this : const instance = new Model(data); Jan 26, 2018 · This could be down to a circular dependency due to importing each model into the other using require(). exec () on the mongoose query (User. save() does not save (does nothing) in mongodb. Update the issue is using: Dec 3, 2021 · Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers; Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand Kindly, use the code below. I required mongoose correctly and am unsure of why I see $(document). Shortcut for validating an array of documents and inserting them into MongoDB if they're all valid. you need to call . example: const member = require('. js:221:11) at _next (C:\code\project\node_modules\hooks May 24, 2017 · Mongoose 4. I have made a Mongoose database schema for a User entity, and want to add the current date in an updated_at field. params. save is not a function"? P. 10. 5. Aug 21, 2020 · And then I want to update that product's price. Mar 3, 2012 · I am trying to use Mongoose to save a record from a defined schema to MongoDB. push(email); await Apr 26, 2016 · models/dbSchema. Usage. I can create a user, and cr Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. stringify, it converts it to [object Object], which makes mongoose angry. Installation. js:174 throw er; // Unhandled 'error' event ^ TypeError: PC. save function doesn't appear to be getting called in node. Feb 20, 2018 · the callback will be executed not after the password has been hashed, but (most likely) after the logic inside the . I'm using the population model population model. save() it can update the document in Apr 27, 2022 · TypeError: this. nextTick function. exports not module. save Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. SessionCard. In this line: Apr 5, 2015 · Connection to mongodb://localhost:27017 established through mongoose. save(function(error) { if May 3, 2021 · When I go to use . Jul 21, 2016 · How to fix . Nov 24, 2020 · I would have expected the save() method to belong to the CharData object, not to data… But, either way, save is deprecated and you’re better off using updateOne as described here. save() fixed it – Omar Commented Jul 12, 2020 at 23:19 Aug 31, 2020 · I am using mongoose version ^5. findOne instead and that worked. But, I looked it up online and it seems like this create is a more generic functions to save objects (that not necessarily needs to be an instance of the model). Can you try changing it back to "Product" and restarting the next server? Jan 24, 2015 · Mongoose Model. Or you can make an async function(req, res) and put await before user. I know this might be way too late for you, but for any future coders that land on this issue, I think this solution should work. 2. But I'm still making changes successfully without using s How to fix . save is not a function in Mongoose. pre("save", async function (next) { // Check to see if password is modified. ) May 4, 2017 · So I voted for the answer which said to just go down to mongodb 2. With save() , you get full validation and middleware . What you'll need to do is either: As you mentioned, use findByIdAndUpdate passing the id and the object to be updated. Why save() in mongoose is not a function? 1. How do I get mongoose to save the change to the database? Aug 30, 2022 · newUser. genUpdatedDate is a function that takes a function as a parameter. Ask Question Asked 3 years, 11 months ago. readyState ) ); Mar 14, 2022 · I tried converting the Mongoose document to an object and it worked fine. Oct 11, 2017 · insertOne command is not available in mongoose directly as mentioned in Mongoose Documentation. If you want to use insertOne command then you need to use bulk command in order to send this command to MongoDB server. Here is the Model: You are closing your request before the user being saved. js code, but mongoose will keep track of object's changes & when you use . js version 19. end() into then function to solve the problem. (Let me know if it's not the case. defineProperty. this is the github repo available. find ()). even though the data is getting saved, its only saving __v _id and the timestamps. /user. createConnection my lambda function would time out I realized there was an issue and doing connection. May 9, 2017 · The new option is not a valid option for the Mongoose update() operation and is not needed. save() does not match what is in the database. Change the below code to : // module. toObject(); Feb 4, 2022 · Mongoose . push(sender); senderData. js, Mongoose, MongoDb, express. Use return or else to guard the rest of the code. ready(function() { Are you trying to use Mongoose in browser? It's supposed to be used on the server-side. readyState. save(function (err) { console. Node version: 12. searchMembers = function (req,res) { Member. Jun 7, 2020 · Problem: I try to delete a document from the database using document. I have already found the problem. Apr 5, 2022 · to handle a chained . mongoDB / NodeJS save() method not working. json(docs) }) } Jun 15, 2022 · How to fix . paginate(). NodeJS - . save inside process. Mistake Dec 26, 2017 · For people on version 3. When hitting the /register route, I get the following error: TypeError: user. save() is a method on a Mongoose document. Why does using mongoose . insert method instead its only ~50ms. Mongoose save function is not working and returns empty {} object. log(newUser) Mar 17, 2019 · How to fix . Oct 27, 2020 · The "save" middleware is calling next() but continuing on to complete the function. log(err); }); You will be able to see the issue if there's any. so any help will be appreciated. requestFriends. Instead of using . save() on a Mongoose Schema object, the object does not entirely get saved to the database - only certain parts of the JSON do. model. save() is not a function. save is not a function. save is not a Jun 20, 2021 · Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. MongoDB doesn't have any save method. For some reason it doesn't seem to like the model being exported as the default, could you try defining the model in user. Do not explicitly set the write concern for the operation if run in a transaction. js:62:30) at fnWrapper (C:\code\project\node_modules\hooks-fixed\hooks. // path to model') //model initiation const Member = new member(); exports. const tag = await new this. async function observePromise { const user = await User. Read more here Example with findOneAndUpdate(): Mar 5, 2020 · Console Output when function is called: doc. save() is not a function Perhaps it's because I've been coding for 8 hours, but I'm failing to see what I'm missing. connect( connectionURL, {useNewUrlParser: true, useUnifiedTopology: true}, => console. If not: register user (and send to him his token), if have: update token (and send to him his updated token). 3 Node. pre('save', function (next) { and you will get the following Nov 5, 2015 · This seems to have solved the problem, the values are now getting posted to the database; thanks for the suggestion. , I had the same issue, I was using this keyword in the wrong place as shortcut [lazyness] for all properties. save() use one of the following options: Example 1 I want to save something to test it, but it's giving me ". save()-function has completed. use('/events', events); and the code establishing the Mongoose connection my app. userSchema. Although now that has me thinking I should just throw my hands up and use a native MongoDB driver instead of mongoose. 8. And also no need to write var Schema = mongoose. 2. You could try to print console. log in the POST and before the save, you can see it works. Object. Help. When i'm trying update some data in my db with . Here is my schema. Nov 10, 2023 · There is no insert method. exports = { UserModel }, then when importing const UserModel = require('. userModel. g 'pre', 'save' etc. mongoose. findById(cardID); Then I want to remove the Card like this: await Card. 0 of the MongoDB native NodeJS driver: (This is applicable to people with "mongodb": "^3. So, it's better to use mongoose-paginate-v2. However when I try to do contact. insertOne on result of database query, it's a function of mongoose model to insert new document to collection but not to insert new fields to objects. Why do I keep getting TypeError: User is not a constructor? 4. Nov 27, 2020 · save() is a method on a Mongoose document. 9. find as promise to model which is imported from models file. Just follow the examples that you have provided via this code: Schema. save()方法保存一个新的用户文档: Nov 24, 2016 · How to fix . Oct 26, 2016 · Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers; Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand May 21, 2021 · The JS interpreter told you that myData. Still a bit curious as to why the original method did not work, but I can live with the alternative. Apr 18, 2020 · As your code is not really awaiting a response from findById() that user variable is undefined hence user. And then I want to save the updated product to the database. The returned value 1 means connected, 0 means not connected and 2 means connecting. i. In browser you need to send AJAX request to the server: Sep 17, 2018 · So apparently the mongoose has a data type of [object Model] and when you use JSON. Schema;. 0. So install mongoose node package to help me. Nov 12, 2016 · Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. 0-rc0", or a later version in package. 8 Express Route Feb 24, 2022 · I'm trying to save it as so: // inside an async function const newUser: HydratedDocument<User> = new UserModel({ email: '[email protected]', }) console. nextTick(function() { throw err; }) ^TypeError: undefined is not a function at showCollections** And here goes showCollections: Apr 24, 2018 · Can you show a "minimal" complete listing as an example please. Check the link that you have already posted. save the object need to be instantiated (like I did with the "new Image()"). remove Jul 3, 2020 · I am using Nodejs, Express and Mongoose to store data. Try replacing the use of require() to import your models:. Note that the second argument, the document, must be the same document that is calling the save. Nov 27, 2020 · The save function in mongoose not working. I created a backend to take data from users through Contact form and save into my dat May 14, 2017 · Here, I check have user in my DB or not. collection property. The save() method is asynchronous, so it returns a promise that you can await on. log(friendData, senderData) friendData. If you want to add them to array you can use the push() method like so:. location_ Jul 10, 2016 · TLDR: Use Create (save is expert-mode) The main difference between using the create and save methods in Mongoose is that create is a convenience method that automatically calls new Model() and save() for you, while save is a method that is called on a Mongoose document instance. Ask Question Asked 5 years, 10 months ago. move the res. it immediately fails next with . I have 2 schemas one for student and one for snippets. Jul 6, 2020 · It was due to unavailability of the document as it is created just after the deletion as I used model. remove() in the following codes, but it does not remove this document from database. S: And how correctly send data to user localStorage? Jul 10, 2015 · So that thing above throws "undefined is not a function" on using model. I am confident remove() is called because t Mar 2, 2020 · Here auth is a middleware that is generating jwt and authorizing user, and I have a mongoose model named Contact. Look at this from the homepage: var fluffy = new Kitten({ name: 'fluffy' }); If data[0] currently has a regular JSON object, we need a line like this to convert to a BSON model object. id const { username, pass Jun 28, 2020 · im new to node and express so this might not be clear. Dec 3, 2017 · Mongoose Save Callback is not working. Jan 4, 2017 · Try the below code: In member_model. userSchema. Jan 11, 2017 · And you did not understand what I meant. create() because it only sends one operation to the server, rather than one for each document. save is not a function Jun 1, 2018 · The problem you have is that both your schema require the other one to work. What do you think is the problem? I keep getting an issue that newUser. save(. pre('save', function() {}) callback but every time I run i Sep 9, 2016 · I am having problem with Mongoose . Reload to refresh your session. to solve this , you need to understand one logic . server. find({},(err,docs)=>{ res. populate('creator'); // summary May 10, 2017 · Found problem by myself: I was passing not the model, on which I can use find operations, but document, on which I can perform save options (not find, since it's not a model). 0. I just had to re-cast the data to a mongoose model and that fixed it. findByIdAndUpdate( options. Mongoose aborts the save since number is required but not defined and no console. Jun 18, 2019 · Mongoose . save is not a function for mongoose in NodeJs. May I suggest that you first try by removing the populate part from your query and testing. js:186:8) at model. I used Pug template engine. 1 MongoDB: 3. class friendService { async addFriend(email, sender) { const friendData = await FriendModel. var events = require('. populate('creator'). A setter wont work here because it only works synchronous. ) I also tried second variant of the snippet (2), let's call it snippet (3), incorporating the . save() it throws me an exception as a contact. Mar 22, 2020 · You can't use . npm install --save mongoose-paginate-v2 @types/mongoose-paginate You need @types/mongoose-paginate if you code with typescript. My problem is: The password is hashed asynchronously. lean() which returns a normal JS object instead of a Mongoose object. Schema. save() is not a function when i am trying to Mar 22, 2016 · I am trying to create a route to register users for my application, but I ran into a problem. Jul 17, 2023 · I can select a document like this: const Card = await db. UserModel Mar 6, 2020 · I got an old nodeJs MongoDb project. setPassword is not a func The save() function is generally the right way to update a document with Mongoose. So, since save() is a middleware inside . findOne() are legal but i Apr 20, 2016 · I'm following along in a few different MEAN tutorials, and I'm getting hung up on something that none of the tutorials seem to encounter. log( mongoose. I rolled back to 5. And fallow the tutorial to do my best. , //no strict to save changes in the valuesBeforeChange field. /routes/events'); app. TypeError: User is not a constructor. Jan 30, 2013 · I am looking for a good way to save an Account to MongoDB using mongoose. Apr 20, 2021 · That means this is not a mongoose object. 在使用Mongoose的过程中,有时候可能会遇到一个错误消息,即”. remove(); But I get this error: TypeError: Card. Load 7 more related Mar 13, 2013 · Also, from the mongoose homepage, it appears that the function callback prototype is function(err, data), not the other way around, which you corrected above. static findById = jest. save() function doesn't work in mongoose. exec() Also doesn't work, throws the same "undefined is not a function" on model. 4. value. subscribe. collection. model("Customer", Schema);) hasn't been called YET. ) So the snippet (3) is this: Jul 1, 2021 · . – Dumindu Dharmawardhana Commented Jul 7, 2020 at 13:25 Mar 10, 2017 · TypeError: newUser. ) i faced this issue . middleName Jun 18, 2017 · So I want to hook into when the address changes, so I can alert users of update. However, due to my app logic, the update object always is like this: Location. When you submit your tweet (called mew in my app) it makes a post request. The second solution unless I'm mistaken is only quicker because its using the native mongoDb driver. pre('save') function does not seem to trigger when saving a Quote elsewhere. 4. How to solve `TypeError: person. I'm using mongoose express in backend. In the code the save function has as option: save({safe: {j: true}}, (e, o) => {}) But "safe" is depreacted. You can do insert(), insertMany(), or if you updated instead of save(), you can simply use replaceOne(). js (in models/admin folder):. e Just the schema and model definition and trying to do something that causes validate to fire. It is indicated to use the option "w" with in Jan 14, 2017 · I was looking at the mongoose code and to me it seems that there is some problem in the populate part of your query. Oct 8, 2015 · [fn] <Function> optional callback with this structure: function(err, theDocumentToBeSaved, [isSaveSuccessful]) and it can be used like the following. It creates or updates a document in the database based on the provided schema, validating the data and saving it as a new entry or updating an existing one. You should use save() to update a document unless you have a good reason not to. save()方法不是一个函数)。这个错误消息通常出现在尝试保存或更新文档时。 例如,在以下代码片段中,我们尝试使用. Feb 22, 2024 · mongoose-paginate does not have a count method. User. yisacgs uufwtldg whoi xbzla vwfzztb cxdj iaobu xxarl qpox nqzkau