Definition¶
$rename
¶The $rename
operator updates the name of a field and has the following form:
The new field name must differ from the existing field name. Tospecify a <field>
in an embedded document, use dot notation.
Class - amazon for mac. Consider the following example:
This operation renames the field nickname
to alias
, and thefield cell
to mobile
.
Rename to rename as rename by Stack Exchange Network Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Lupas Rename is a FREEWARE program developed to rename a few or a massive number of files with a lot of features It works on Win95, Win98, WinME, WinNT, Win2K and WinXP. It is a simple.EXE file and doesn't need any other external libraries.
Behavior¶
The $rename
operator logically performs an $unset
of both the old name and the new name, and then performs a$set
operation with the new name. As such, the operation maynot preserve the order of the fields in the document; i.e. the renamedfield may move within the document.
- Rename fails with PHP4 and PHP5 under Windows if the destination file exists, regardless of file permission settings. I now use a function similar to that of ddoyle at canadalawbook dot ca, which first tries rename, checks if it returned FALSE and then uses copy/unlink if it failed.
- Rename synonyms, rename pronunciation, rename translation, English dictionary definition of rename. Vb to change the name of Collins English Dictionary.
If the document already has a field with the <newName>
, the$rename
operator removes that field and renames the specified<field>
to <newName>
.
If the field to rename does not exist in a document, $rename
does nothing (i.e. no operation).
For fields in embedded documents, the $rename
operator canrename these fields as well as move the fields in and out of embeddeddocuments. $rename
does not work if these fields are in arrayelements.
Examples¶
A collection students
contains the following documents where afield nmae
appears misspelled, i.e. should be name
:
The examples in this section successively updates the documents in thecollection.
Rename a Field¶
To rename a field, call the $rename
operator with the currentname of the field and the new name:
This operation renames the field nmae
to name
for all documentsin the collection:
Rename a Field in an Embedded Document¶
To rename a field in an embedded document, call the $rename
operator using the dot notation to referto the field. If the field is to remain in the same embedded document,also use the dot notation in the new name, as in the following:
This operation renames the embedded field first
to fname
:
Rename a Field That Does Not Exist¶
When renaming a field and the existing field name refers to a fieldthat does not exist, the $rename
operator does nothing, as inthe following:
This operation does nothing because there is no field namedwife
.
© MongoDB, Inc 2008-present. MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
Also found in: Thesaurus, Medical, Acronyms, Encyclopedia, Wikipedia.
rename
(riːˈneɪm)rename
Past participle: renamed
Gerund: renaming
Imperative |
---|
rename |
rename |
Present |
---|
I rename |
you rename |
he/she/it renames |
we rename |
you rename |
they rename |
Preterite |
---|
I renamed |
you renamed |
he/she/it renamed |
we renamed |
you renamed |
they renamed |
Present Continuous |
---|
I am renaming |
you are renaming |
he/she/it is renaming |
we are renaming |
you are renaming |
they are renaming |
Present Perfect |
---|
I have renamed |
you have renamed |
he/she/it has renamed |
we have renamed |
you have renamed |
they have renamed |
Past Continuous |
---|
I was renaming |
you were renaming |
he/she/it was renaming |
we were renaming |
you were renaming |
they were renaming |
Past Perfect |
---|
I had renamed |
you had renamed |
he/she/it had renamed |
we had renamed |
you had renamed |
they had renamed |
Future |
---|
I will rename |
you will rename |
he/she/it will rename |
we will rename |
you will rename |
they will rename |
Future Perfect |
---|
I will have renamed |
you will have renamed |
he/she/it will have renamed |
we will have renamed |
you will have renamed |
they will have renamed |
Future Continuous |
---|
I will be renaming |
you will be renaming |
he/she/it will be renaming |
we will be renaming |
you will be renaming |
they will be renaming |
Present Perfect Continuous |
---|
I have been renaming |
you have been renaming |
he/she/it has been renaming |
we have been renaming |
you have been renaming |
they have been renaming |
Future Perfect Continuous |
---|
I will have been renaming |
you will have been renaming |
he/she/it will have been renaming |
we will have been renaming |
you will have been renaming |
they will have been renaming |
Past Perfect Continuous |
---|
I had been renaming |
you had been renaming |
he/she/it had been renaming |
we had been renaming |
you had been renaming |
they had been renaming |
Conditional |
---|
I would rename |
you would rename |
he/she/it would rename |
we would rename |
you would rename |
they would rename |
Past Conditional |
---|
I would have renamed |
you would have renamed |
he/she/it would have renamed |
we would have renamed |
you would have renamed |
they would have renamed |
Verb | 1. | rename - assign a new name to; 'Many streets in the former East Germany were renamed in 1990' call, name - assign a specified (usually proper) proper name to; 'They named their son David'; 'The new school was named after the famous Civil Rights leader' |
2. | rename - name again or anew; 'He was renamed Minister of the Interior' name, nominate, make - charge with a function; charge to be; 'She was named Head of the Committee'; 'She was made president of the club' |
rename
[ˈriːˈneɪm]VT → ponernuevonombre athey have renamed it 'Mon Repos' → le han puesto el nuevonombre de 'Mon Repos'
rename
[ˌriːˈneɪm]vt [+ person, town, building, company, organization] → rebaptiser; [+ computer file] → renommerRenamergen
rename
Want to thank TFD for its existence? Tell a friend about us, add a link to this page, or visit the webmaster's page for free fun content.
Rename Files With Numbers
Link to this page: