Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- match (m)-[r]-() delete r
- match (m) delete m
- match (m) return m
- MATCH (a)-[*0..]-(b)
- WITH DISTINCT a, collect(DISTINCT b) AS sets
- RETURN DISTINCT sets
- GOOGLE_APPLICATION_CREDENTIALS=d:\hackathon\google-api-key.json
- http://localhost:7474/service/mazerunner/analysis/connected_components/HAS_KEYWORD
- curl -H "Content-Type: application/json" -X POST -d '{"password":"123456"}' -u neo4j:neo4j http://brainstash-db.northeurope.cloudapp.azure.com:7474/user/neo4j/password
- @Bean
- CommandLineRunner commandLineRunner(NeuronService neuronService) {
- return __ -> {
- List<Keyword> tags1 = Arrays.asList(new Keyword("cool"), new Keyword("java"),
- new Keyword("c#"), new Keyword("awesome"));
- List<Keyword> tags2 = Arrays.asList(new Keyword("cooking"), new Keyword("chicken"),
- new Keyword("food"));
- for (int i = 0; i < 100; i++) {
- Neuron neuron = new Neuron();
- neuron.setTitle("TITLE #" + i);
- Collections.shuffle(tags1);
- neuron.setKeywords(tags1.subList(0, tags1.size() - 2));
- neuronService.createNeuron(neuron);
- }
- for (int i = 0; i < 30; i++) {
- Neuron neuron = new Neuron();
- neuron.setTitle("COOKING #" + i);
- Collections.shuffle(tags2);
- neuron.setKeywords(tags2.subList(0, tags2.size() - 1));
- neuronService.createNeuron(neuron);
- }
- };
- }
- @Bean
- CommandLineRunner commandLineRunner(UserService userService, NeuronRepository neuronRepository) {
- return __ -> {
- User newUser = new User("brainstash@gmail.com");
- List<Neuron> all = Lists.newArrayList(neuronRepository.findAll().iterator());
- newUser.setNeurons(all);
- userService.createUser(newUser);
- };
- }
- @Bean
- CommandLineRunner commandLineRunner(NeuronService neuronService, UserService userService, NeuronRepository neuronRepository) {
- return __ -> {
- User newUser = new User("brainstash@gmail.com");
- List<Neuron> all = Lists.newArrayList(neuronRepository.findAll().iterator());
- newUser.setNeurons(all);
- User createdUser = userService.createUser(newUser);
- List<Keyword> tags1 = Arrays.asList(new Keyword("cool"), new Keyword("java"),
- new Keyword("c#"), new Keyword("awesome"));
- List<Keyword> tags2 = Arrays.asList(new Keyword("cooking"), new Keyword("chicken"),
- new Keyword("food"));
- for (int i = 0; i < 100; i++) {
- Neuron neuron = new Neuron();
- neuron.setTitle("TITLE #" + i);
- Collections.shuffle(tags1);
- neuron.setKeywords(tags1.subList(0, tags1.size() - 2));
- neuronService.createNeuronForUser(neuron, createdUser);
- }
- for (int i = 0; i < 30; i++) {
- Neuron neuron = new Neuron();
- neuron.setTitle("COOKING #" + i);
- Collections.shuffle(tags2);
- neuron.setKeywords(tags2.subList(0, tags2.size() - 1));
- neuronService.createNeuronForUser(neuron, createdUser);
- }
- User byEmail = userService.findByEmail("brainstash@gmail.com");
- System.out.println(byEmail.getNeurons());
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement