Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Fetch

...

Method

'this'

...

When fetching a type Type which has as property another typeType, you can use the 'this' keyword in the 'include' field of the fetch spec to get the entire subordinate object. for For example,TypeA.c3typ:

Code Block
entity type TypeA schema name "TypeA" {
name: string
child: TypeB
}

...

Code Block
languagepy
c3.TypeA.fetch({'include': 'child.this'})

Clearing Metadata Errors

Whenever you provision a C3 package to your tag , you will get a multitude of metadata warnings, and in some cases errors. This results in the following yellow or red banner at the top of your static console.:

to To clear these errors, simply issue the following in static console:

Code Block
languagejs
DbMetadataIssue.removeAll()

in the static console orOr this for a connected python session:

Code Block
languagepy
c3.DbMetadataIssue.removeAll()

through a connected python session.

...

Cleaning Your Tag

When developing a C3 package, you frequently need to provision and re-provision progressively changing versions of a given package. This can result in older versions of your data lingering on your Tag tag even though you're no longer using it. Additionally, when you use your using your tag for a different package, you may leave behind old data which is not used.

There are two options for cleaning data.

Cleaning

...

Type Data

Suppose you want to remove the data associated with the Type 'TypeName'. All that's needed in this case is the 'removeAll' command . As followsin static console:

Code Block
languagejs
TypeName.removeAll()

for JavaScript, andOr this for a connected python session:

Code Block
languagepy
c3.TypeName.removeAll()

for Python.

...

Cleaning All Data

You can remove all data from your tag with the `removeData` `removeData` method. Please be aware , that not all users are authorized to do this.

From static console:

Code Block
languagejs
Tag.removeData()

for JavaScript, andFrom a connected python session:

Code Block
languagepy
c3.Tag.removeData()

for Python.

Warning: Please be aware that this command will remove all data from your tag. Please be sure you are really finished using that data, or back it up if necessary.

Checking Your Authorization

For some of the above commands, you You may not be authorized to execute itsome of the above commands. To check this, you can use the Authorizer Type. For example, to check whether Tag.removeData is allowed, execute the following in JavaScriptstatic console:

Code Block
languagejs
Authorizer.isAuthorized("Tag", "removeData")

or

Code Block
languagejs


// or

Authorizer.actionAuthzRoles({typeName: {typeName: 'Tag'}, action: 'removeData'})

and And the same in Python would be:

Code Block
languagepy
c3.Authorizer.isAuthorized("Tag", "removeData")

or

Code Block
languagepy


# or

c3.Authorizer.actionAuthzRoles(spec={'typeName': {'typeName': 'Tag'}, 'action': 'removeData'})

Checking

...

C3 Server

...

Version

Sometimes you may need to know the version of the C3 server Server you're using. You can do this from the static console with the following:

Code Block
server_version = Cluster.hosts()[0].serverInfo.buildCITag

Checking the

...

Provisioned Package

Code Block
c3Grid(TagProvisionLog.fetch({
    order: "descending(deployDate)",
    limit: 1
}))

...